rect 的結構還是不太清楚,有時間再看看。
#include
#define id_timer 1
lresult callback wndproc (hwnd, uint, wparam, lparam) ;
int winapi winmain (hinstance hinstance, hinstance hprevinstance,
pstr szcmdline, int icmdshow)
hwnd hwnd ;
msg msg ;
wndclass wndclass ;
wndclass.style = cs_hredraw | cs_vredraw ;
wndclass.lpfnwndproc = wndproc ;
wndclass.cbcl***tra = 0 ;
wndclass.cbwndextra = 0 ;
wndclass.hinstance = hinstance ;
wndclass.hcursor = loadcursor (null, idc_arrow) ;
wndclass.hbrbackground = (hbrush) getstockobject (white_brush) ;
wndclass.lpszmenuname = null ;
if (!registerclass (&wndclass))
messagebox ( null, text ("program requires windows nt!"),
return 0 ;
cw_usedefault, cw_usedefault,
cw_usedefault, cw_usedefault,
null, null, hinstance, null) ;
showwindow (hwnd, icmdshow) ;
updatewindow (hwnd) ;
while (getmessage (&msg, null, 0, 0))
translatemessage (&msg) ;
dispatchmessage (&msg) ;
return msg.wparam ;
lresult callback wndproc (hwnd hwnd, uint message, wparam wparam,lparam lparam)
static bool fflipflop = false ;
hbrush hbrush ;
hdc hdc ;
paintstruct ps ;
static rect rc ;
static int cxchar;
static int cychar;
switch (message)
case wm_create:
settimer(hwnd, 1,1000, null);
cxchar = loword (getdialogbaseunits ()) ;
cychar = hiword (getdialogbaseunits ()) ;
return 0;
case wm_size:
rc.left = 24 * cxchar ;
rc.top = 24 * cychar ;
rc.right = loword (lparam) ;
rc.bottom = hiword (lparam) ;
return 0;
case wm_timer:
switch (wparam)
case 1:
fflipflop = !fflipflop;
invalidaterect(hwnd,&rc,true);
break;
return 0;
case wm_paint:
hdc=beginpaint(hwnd,&ps);
getclientrect(hwnd,&rc);
hbrush = createsolidbrush(fflipflop ? rgb(255,0,0) : rgb(0,0,255));
fillrect(hdc,&rc,hbrush);
endpaint(hwnd,&ps);
deleteobject(hbrush);
return 0;
case wm_destroy:
killtimer(hwnd,1);
postquitmessage(0);
return 0;
return defwindowproc( hwnd, message, wparam, lparam);
hdc hdc;
paintstruct ps;
rect rc;
static bool fflog = false;
hbrush hbrush;
switch (message)
case wm_create:
settimer( hwnd, 1, 1000, null);
return 0;
case wm_timer:
switch(wparam)
case 1:
fflog=!fflog;
invalidaterect(hwnd,null,false);
break;
return 0;
case wm_paint:
hdc = beginpaint(hwnd,&ps);
getclientrect(hwnd,&rc);
hbrush = createsolidbrush(fflog ? rgb(0,255,0) : rgb(0,0,255));
fillrect(hdc,&rc,hbrush);
endpaint(hwnd,&ps);
deleteobject(hbrush);
return 0;
case wm_destroy:
postquitmessage(0);
killtimer(hwnd,1);
return 0;
return defwindowproc( hwnd, message, wparam, lparam);
突然還是沒明白
不知是誰說過,青春歲月 無需留白 但我觸碰到你璀璨的青春時 留下的只是我看透你錯亂的那種心情 總會有一些人停留在你的心底 任憑歲月怎樣的過遷 你和他們的那份情都不會減少一絲 無論你在外面如何的漂流 但是當你有天回到他身邊時 一切就像沒分開時那樣的美好 在這個忽冷忽熱的四月裡 所有的一切都是那樣的昏暗...
!網路太渣,不開森。為何我沒多學點網路!
領導昨天發簡訊說今下午要來看demo,讓準備好等他來。昨晚熬夜把demo趕了個差不多,今早早早的也來了辦公室,再檢驗一遍,嗯,執行ok。然後說,看電腦上demo吧。ok。我開。但是開個網頁什麼的等等還是能出頁面的。默默開啟terminal,ping ip 我說,網路不好,我不擅長網路。領導說,你就去...
一道一直沒弄明白的sql 有關group
我的答案 我的想法就是先把錶按照emp no給合併起來,然後對這個新錶t進行篩選最大的工資並且按照部門分組。select t.dept no,t.emp no,max t.salary as maxsalary from select d.dept no,d.emp no,s.salary from...