Code :
#include <stdio.h> #include <windows.h> // Programme permettant de supprimer la barre de titre // des fenetres VAPS pour le projet EIS2 int Resizable = FALSE; int main(int argc, char *argv[]) { char cWindowName[256]; HWND hWindow; LONG current_style, new_style; LONG_PTR style; if (argc < 2) { printf("Usage : %s titre\n", argv [0]); return (0); } strcpy(cWindowName, argv[1]); if (argc == 3) Resizable = strcmp(argv[2], "RESIZE" ) == 0; hWindow = FindWindow(NULL, cWindowName); if (hWindow) { printf("Found window %s\n", cWindowName ); current_style = GetWindowLong (hWindow, GWL_STYLE); printf("Current style of the window = %x\n", current_style ); // Suppression titre fenetre seulement new_style = current_style & ~WS_OVERLAPPEDWINDOW; if (Resizable) new_style |= WS_THICKFRAME; //SetLastError(0); style = SetWindowLongPtr(hWindow, GWL_STYLE, new_style); printf("Send new style to the window = %x\n", new_style ); } else { printf("Error, window %s not found ...\n", cWindowName ); } return 0; }
|