{"id":48,"date":"2008-09-25T17:44:04","date_gmt":"2008-09-25T17:44:04","guid":{"rendered":"http:\/\/kumouse.aafox.com\/?p=48"},"modified":"2008-09-25T17:44:04","modified_gmt":"2008-09-25T17:44:04","slug":"%e5%85%a8%e5%b1%80%e7%83%ad%e9%94%ae%e9%9a%90%e8%97%8f%e5%bd%93%e5%89%8d%e7%aa%97%e5%8f%a3delphi-%e6%94%b9%e5%86%99%e4%b8%ba%e6%b1%87%e7%bc%96","status":"publish","type":"post","link":"https:\/\/www.kumouse.com\/?p=48","title":{"rendered":"\u5168\u5c40\u70ed\u952e\u9690\u85cf\u5f53\u524d\u7a97\u53e3(delphi \u6539\u5199\u4e3a\u6c47\u7f16)"},"content":{"rendered":"<p>\u6211\u7528\u7684\u662fMASMPlus\u7684\u6807\u51c6WIN EXE\u6a21\u677f<br \/>\u5728\u672c\u7f51\u7ad9\u7684<a href=\"http:\/\/www.kumouse.com\/article.asp?id=41\" title=\"http:\/\/www.kumouse.com\/article.asp?id=41\" target=\"_blank\">http:\/\/www.kumouse.com\/article.asp?id=41<\/a>\u53ef\u4ee5\u4e0b\u8f7d\u5230<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:(delphi)<\/p>\n<blockquote><p>program open;<\/p>\n<p>uses<br \/>  Windows;<\/p>\n<p>{$R *.res}<\/p>\n<p>const<br \/>  WM_HOTKEY = $0312;<\/p>\n<p>var<br \/>  WinH : Longint=0;<br \/>  Msg  : tMsg;<\/p>\n<p>begin<br \/>  MessageBox(<br \/>    GetActiveWindow(),<br \/>    PChar(&#39;\u70ed\u952e\uff1aALT+Z \u529f\u80fd\uff1a\u9690\u85cf\u5f53\u524d\u7a97\u53e3  \u4f5c\u8005\uff1a\u7f8e\u4e3d\u4eba\u751f&#39;),<br \/>    PChar(&#39;\u8bf4\u660e&#39;),<br \/>    MB_OK);<\/p>\n<p>  RegisterHotKey(0,0,MOD_ALT,ord(&#39;Z&#39;));  \/\/\u6ce8\u518cAlt+Z<br \/>  while GetMessage(Msg, 0, 0, 0) do<br \/>    if Msg.message=WM_HOTKEY then<br \/>      if WinH=0 then<br \/>      begin<br \/>        WinH:=GetForegroundWindow;<br \/>        ShowWindow(WinH,SW_HIDE);<br \/>      end<br \/>      else<br \/>      begin<br \/>        ShowWindow(WinH,SW_SHOW);<br \/>        WinH:=0;<br \/>      end;<br \/>end.<\/p><\/blockquote>\n<p>\u4ee3\u7801\u5982\u4e0b:(\u6c47\u7f16)<\/p>\n<blockquote><p>.386<br \/>.Model Flat, StdCall<br \/>Option Casemap :None<\/p>\n<p>Include windows.inc<br \/>Include user32.inc<br \/>Include kernel32.inc<br \/>Include gdi32.inc<\/p>\n<p>includelib gdi32.lib<br \/>IncludeLib user32.lib<br \/>IncludeLib kernel32.lib<br \/>;include macro.asm<\/p>\n<p>    WinMain PROTO :DWORD,:DWORD,:DWORD,:DWORD<br \/>    WndProc PROTO :DWORD,:DWORD,:DWORD,:DWORD<\/p>\n<p>    idMyHotKey    equ    2008<br \/>    idMyHotKeyq    equ    2009<\/p>\n<p>.const <br \/>szFmt_d    db   &#39;%d&#39;, 0 <\/p>\n<p>.DATA<br \/>    szClassName db &quot;hide windows&quot;,0<br \/>    szCaption    db &quot;http&#58;\/\/www.kumouse.com&quot;,0<br \/>    szt db &quot;\u70ed\u952e\uff1aALT+Z \u529f\u80fd\uff1a\u9690\u85cf\u5f53\u524d\u7a97\u53e3 CTRT+Q \u5173\u95ed\u70ed\u952e \u4f5c\u8005\uff1a\u7f8e\u4e3d\u4eba\u751f&quot;,0<br \/>    szc db &quot;\u8bf4\u660e&quot;,0<\/p>\n<p>.DATA?<br \/>    hInstance    dd ?<br \/>    hFind HINSTANCE ?<\/p>\n<p>.CODE<br \/>START:<\/p>\n<p>    invoke GetModuleHandle,NULL<br \/>    mov hInstance,eax<br \/>    invoke WinMain,hInstance,NULL,NULL,SW_SHOWDEFAULT<br \/>    invoke ExitProcess,0<\/p>\n<p>WinMain proc hInst:DWORD,hPrevInst:DWORD,CmdLine:DWORD,CmdShow:DWORD<br \/>    LOCAL wc :WNDCLASSEX<br \/>    LOCAL msg :MSG<br \/>    local hWnd :HWND<\/p>\n<p>    mov wc.cbSize,sizeof WNDCLASSEX<br \/>    mov wc.style,CS_HREDRAW or CS_VREDRAW or CS_BYTEALIGNWINDOW<br \/>    mov wc.lpfnWndProc,offset WndProc<br \/>    mov wc.cbClsExtra,NULL<br \/>    mov wc.cbWndExtra,NULL<br \/>    push hInst<br \/>    pop wc.hInstance<br \/>    mov wc.hbrBackground,COLOR_BTNFACE+1<br \/>    mov wc.lpszMenuName,NULL<br \/>    mov wc.lpszClassName,offset szClassName<br \/>    ;invoke LoadIcon,hInst,100<br \/>    mov wc.hIcon,NULL<br \/>    ;invoke LoadCursor,NULL,IDC_ARROW<br \/>    mov wc.hCursor,NULL<br \/>    mov wc.hIconSm,0<br \/>    invoke RegisterClassEx, ADDR wc<br \/>    ;invoke CreateWindowEx,NULL,ADDR szClassName,CTXT(&quot;http&#58;\/\/www.kumouse.com&quot;),WS_OVERLAPPEDWINDOW,200,200,400,200,NULL,NULL,hInst,NULL<br \/>    invoke CreateWindowEx,NULL,ADDR szClassName,addr szCaption,WS_OVERLAPPEDWINDOW,200,200,400,200,NULL,NULL,hInst,NULL<br \/>    mov hWnd,eax<br \/>    ;invoke ShowWindow,hWnd,SW_SHOWNORMAL<br \/>    invoke UpdateWindow,hWnd<\/p>\n<p>    StartLoop:<br \/>        invoke GetMessage,ADDR msg,NULL,0,0<br \/>            cmp eax, 0<br \/>            je ExitLoop<br \/>                invoke TranslateMessage, ADDR msg<br \/>                invoke DispatchMessage, ADDR msg<br \/>            jmp StartLoop<br \/>    ExitLoop:<\/p>\n<p>mov eax,msg.wParam<br \/>ret<br \/>WinMain endp<\/p>\n<p>WndProc proc hWin:DWORD,uMsg:DWORD,wParam :DWORD,lParam :DWORD<br \/>    local cBuf[32]:BYTE<\/p>\n<p>    .if uMsg==WM_CREATE<\/p>\n<p>        invoke RegisterHotKey,hWin,idMyHotKey,MOD_ALT,VK_Z  ;\u5b9a\u4e49\u70ed\u952e<br \/>        invoke RegisterHotKey,hWin,idMyHotKeyq,MOD_CONTROL,VK_Q<br \/>        invoke MessageBox,NULL,addr szt,addr szc,1<\/p>\n<p>    .elseif uMsg == WM_HOTKEY       ;\u5904\u7406\u70ed\u952e\u6d88\u606f   &nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;;invoke wsprintf, ADDR cBuf, ADDR szFmt_d,lParam <br \/>&nbsp;&nbsp;&nbsp;&nbsp;;invoke MessageBox,NULL,addr cBuf,addr cBuf,1 <br \/>        .if lParam == 5a0001h<br \/>         &nbsp;&nbsp;.if hFind == 0<br \/>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;invoke GetForegroundWindow<br \/>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mov hFind,eax<br \/>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;invoke ShowWindow,hFind,SW_HIDE<br \/>        &nbsp;&nbsp;&nbsp;&nbsp;.elseif hFind != 0<br \/>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;invoke ShowWindow,hFind,SW_SHOW<br \/>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mov hFind,0<br \/>        &nbsp;&nbsp;pop eax<br \/>        &nbsp;&nbsp;&nbsp;&nbsp;.endif<br \/>        .elseif lParam == 510002h<br \/>         &nbsp;&nbsp;invoke SendMessage,hWin,WM_DESTROY,NULL,NULL<br \/>        .endif<\/p>\n<p>    .elseif uMsg == WM_DESTROY<\/p>\n<p>        invoke UnregisterHotKey,hWin,idMyHotKey     ;\u53d6\u6d88\u5b9a\u4e49\u7684\u70ed\u952e<br \/>        invoke UnregisterHotKey,hWin,idMyHotKeyq<\/p>\n<p>        invoke PostQuitMessage,NULL<br \/>    .else<br \/>        invoke DefWindowProc,hWin,uMsg,wParam,lParam<br \/>    .endif<br \/>    ret<br \/>WndProc endp<br \/>END START<\/p>\n<\/blockquote>\n<p>\u539f\u7801\u4e0b\u8f7d:<br \/><a href=\"uploads\/200809\/25_175644_hidewindowsasm.rar\" title=\"uploads\/200809\/25_175644_hidewindowsasm.rar\" target=\"_blank\">\u70b9\u51fb\u4e0b\u8f7d<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u7528\u7684\u662fMASMPlus\u7684\u6807\u51c6WIN EXE\u6a21\u677f\u5728\u672c\u7f51\u7ad9\u7684http:\/\/www.kumouse.com\/art [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-12"],"_links":{"self":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=48"}],"version-history":[{"count":0,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts\/48\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}