1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
DWORD Action(char); // Déclaration de ma fonction
char idFreeBox[10]; // Déclaration d'une chaine de 10 caratères
int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) {
....
return messages.wParam;
}
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_CREATE:
GetPrivateProfileStringA("section", "id_VotreFreeBox", "-1", idFreeBox, 10, ".//script.ini" );
//MessageBoxA (0, idFreeBox, idFreeBox, 0x40); idFreeBox contient bien la chaine souhaitée
break;
case WM_LBUTTONDOWN:
DWORD Action(char idFreeBox); // là ça ne compile pas
return 0;
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
DWORD Action(szAction) {
// "http://hd1.freebox.fr/pub/remote_control?code=67265672&key=1"
char THEURL[255];
char site[] = "http://hd1.freebox.fr/pub/remote_control?code=";
//char idFreeBox[] = "67265672";
char et[] = "&key=";
char key1[] = "1";
char key5[] = "info";
CURL *session = curl_easy_init();
lstrcpy (THEURL, site);
lstrcat (THEURL, idFreeBox);
lstrcat (THEURL, et);
lstrcat (THEURL, szAction);
curl_easy_setopt(session, CURLOPT_URL, THEURL);
curl_easy_perform(session);
curl_easy_cleanup(session);
MessageBoxA (0, THEURL, idFreeBox, 0x40);
return 0;
} |
Partager