Gmail の新着メールをチェックするソフト GTray

  http://torrez.us/archives/2004/05/23/272

mod_security の XSS 対策ルールを作成する

  http://www.atmarkit.co.jp/fsecurity/rensai/webhole12/webhole01.html

わかりにくい MS04-028

  http://altba.com/bakera/hatomaru.aspx/ebi/topic/1987

  確かに全くもって分かりにくい

コマンドライン引数をクリップボードに格納するツール

急に必要になったから,作ってみた.

#include <windows.h>

#pragma comment(lib, "user32.lib")
#pragma comment(linker, "/opt:nowin98")

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {

    HGLOBAL hText;
    int iLength = strlen(lpCmdLine);
    char *pText;
    
    if (iLength == 0) {
        return 0;
    }
    
    hText = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, iLength + 1);
    if (hText) {
        pText = GlobalLock(hText);
        if (pText) {
            OpenClipboard(NULL);
            EmptyClipboard();
            
            lstrcpy(pText, lpCmdLine);
            GlobalUnlock(hText);
            
            SetClipboardData(CF_TEXT, hText);
            CloseClipboard();
        }
    }
    GlobalFree(hText);
    
    return 0;
}