Salut!
Si tu apprends l'API Win32, c'est pas Google qui t'aidera le plus, mais certainement le MSDN. Essaye ceci : RECT desktopSize;
int x = CW_USEDEFAULT, y = CW_USEDEFAULT, width = 640, height = 480;
if (GetWindowRect(GetDesktopWindow(), &desktopSize)) {
x = (desktopSize.right - width) / 2;
y = (desktopSize.bottom - height) / 2;
}
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
"WindowsApp", /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
x, /* Windows decides the position */
y, /* where the window ends up on the screen */
width, /* The programs width */
height, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
C'est une modification du code produit par Dev-Cpp lors de la création d'une application graphique Win32.
@+
-------
Mieux vaut fermer sa gueule et passer pour un con que l'ouvrir et ne laisser aucun doute à ce sujet.
Gustave Parking
|