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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
| HINSTANCE hInstance;
HWND hServerIP = NULL;
TCHAR IP_buffer[16] = "";
HWND hProgress_bar = NULL;
int APIENTRY WinMain(HINSTANCE cetteInstance, HINSTANCE precedenteInstance, LPSTR lignesDeCommande, int modeAffichage)
{
HWND main_window;
MSG msg;
WNDCLASS win_class;
hInstance = cetteInstance;
win_class.style = 0;
win_class.lpfnWndProc = mainWindowProc;
win_class.cbClsExtra = 0;
win_class.cbWndExtra = 0;
win_class.hInstance = NULL;
win_class.hIcon = LoadIcon(NULL, IDI_APPLICATION);
win_class.hCursor = LoadCursor(NULL, IDC_ARROW);
win_class.hbrBackground = (HBRUSH) (CreateSolidBrush(RGB(32, 167, 171)));
win_class.lpszMenuName = NULL;
win_class.lpszClassName = "classF";
if(!RegisterClass(&win_class))
return FALSE;
main_window = CreateWindow("classF", "WinLog 2.0", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 516, 250, NULL, NULL, cetteInstance, NULL);
if(!main_window)
return FALSE;
ShowWindow(main_window, modeAffichage);
UpdateWindow(main_window);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
UnhookWindowsHookEx(hKbHook);
return (int)msg.wParam;
}
LRESULT CALLBACK mainWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
HICON hIcon;
/**
LPDRAWITEMSTRUCT pdis;
LRESULT move;
**/
int ret = 0;
/**
static int X = 0;
static int Y = 0;
**/
size_t flag = 0;
SOCKET sock = 0;
SOCKADDR_IN sin;
long weight = 0;
long tailleBlockRecut = 0;
long data_len = 0;
long totalRcv = 0;
int empty_log = 0;
char buffer[MAXDATASIZE] = "";
FILE *download_log_file = NULL;
long step_foreward = 0.;
HWND hstatic;
switch(msg)
{
case WM_CREATE :
hstatic = CreateWindow("STATIC", "MyPicture",
WS_CHILD | WS_VISIBLE| SS_BITMAP,
10, 10, 0, 0, hwnd, NULL, hInstance, NULL);
FillWindow(hwnd);
return 0;
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
RECT rect;
HBRUSH brush;
/*
GetClientRect(hwnd, &rect);
rect.bottom = rect.bottom - 205;
*/
brush = CreateSolidBrush(RGB(192, 192, 192));
FillRect(hdc, &rect, brush);
/*
HBITMAP hBmp;
HDC hdc;
PAINTSTRUCT ps;
hBmp=LoadBitmap(hInstance,"images\\BG_1.bmp");
hdc = BeginPaint(hwnd, &ps);
DrawState(hdc,NULL,NULL,(long)hBmp,NULL,10,10,0,0,DST_BITMAP);
*/
EndPaint(hwnd, &ps);
//DeleteObject(hBmp);
/*
Draw_LeftRightBottom_Rectangles(rect, hdc, brush, X, Y);
SetBkColor(hdc, RGB(192, 192, 192));
SetTextColor(hdc, RGB(0, 0, 0));
TextOut(hdc, 210, 5, TEXT("WinLog 2.0"), 10);
SetBkColor(hdc, RGB(32, 167, 171));
SetTextColor(hdc, RGB(0, 0, 0));
TextOut(hdc, 418, 170, TEXT("Made by"), 7);
SetBkColor(hdc, RGB(32, 167, 171));
SetTextColor(hdc, RGB(0, 0, 0));
TextOut(hdc, 423, 188, TEXT("Code Rom"), 8);
*/
hIcon = (HICON)LoadIcon(hInstance, IDI_APPLICATION);
DrawIconEx(hdc, 5, 5, hIcon, 20, 20, 0, brush, 0);
/*
EndPaint(hwnd, &ps);
DeleteObject(hBackground);
*/
return 0;
}
VOID FillWindow(HWND main_window)
{
static HWND button[5] = {NULL};
/*
HWND minimize_butto
int i = 0;
button[0] = CreateWindow(TEXT("BUTTON"), TEXT("Button 1"), WS_CHILD | WS_VISIBLE, 20, 95, 164, 30, main_window, (HMENU)ID_B_SCREENSHOT, hInstance, NULL);
button[1] = CreateWindow(TEXT("BUTTON"), TEXT("Button 2"), WS_CHILD | WS_VISIBLE, 20, 150, 164, 30, main_window, (HMENU)ID_B_MULTI_SCREENSHOTS, hInstance, NULL);
button[2] = CreateWindow(TEXT("BUTTON"), TEXT("Button 3"), WS_CHILD | WS_VISIBLE, 190, 95, 160, 30, main_window, (HMENU)ID_B_IMPORTLOG, hInstance, NULL);
button[3] = CreateWindow(TEXT("BUTTON"), TEXT("Button 4"), WS_CHILD | WS_VISIBLE, 300, 150, 80, 30, main_window, (HMENU)ID_B_INIT, hInstance, NULL);
button[4] = CreateWindow(TEXT("BUTTON"), TEXT("Button 5"), WS_CHILD | WS_VISIBLE, 356, 95, 124, 30, main_window, (HMENU)ID_B_QUIT, hInstance, NULL);
for(i = 0; i < 4; i++)
{
if(!button[i])
return;
}
return;
} |
Partager