「C/C++」の編集履歴(バックアップ)一覧はこちら
「C/C++」(2009/12/18 (金) 01:02:08) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
-------------------------------------------------------------------------
イベントの数々
http://www.river.sannet.ne.jp/yuui/WinDlg/WinMsg.html
http://www.monmon-dance.com/win32api/index.html
---------------------------
ドラッグ&ドロップ イベントのの作り方
http://web.archive.org/web/20040714220349/http://zidney.define.jp/programing/wm/wm_dropfiles/
------------------------------------
ドラッグ&ドロップのサンプル
#include "stdafx.h"
#define MAX_LOADSTRING 100
#include <Windows.h>
typedef struct _DROPFILES {
DWORD pFiles;
POINT pt;
BOOL fNC;
BOOL fWide;
} DROPFILES, *LPDROPFILES;
const char *FileNameList[]={
"C:\\Users\\ookubo\\Desktop\\ivent.vbs",
NULL,
};
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR arg, INT cmdShow)
{
HWND hwnd;
hwnd = FindWindow(NULL,"Adobe Reader");
#if 0
//アプリケーションの終了
if(hwnd != NULL){
PostMessage(hwnd,WM_CLOSE,NULL,NULL);
}
#endif
//ドラッグ&ドロップイベントの作成
// ファイル名の記述に必要なメモリ量を計算
int size=0;
for(int i=0;FileNameList[i];i++)
size+=strlen(FileNameList[i])+1;
size++;
HANDLE hMem=GlobalAlloc(GMEM_ZEROINIT,sizeof(DROPFILES)+size);
char *p=(char *)GlobalLock(hMem);
DROPFILES *DropFiles=(DROPFILES *)p;
DropFiles->pFiles=sizeof(*DropFiles);
DropFiles->pt.x=20;
DropFiles->pt.y=30;
DropFiles->fNC=1;
DropFiles->fWide=0;
p+=sizeof(*DropFiles);
for(int i=0;FileNameList[i];i++){
strcpy(p,FileNameList[i]);
p+=strlen(p)+1;
}
*p='\0';
GlobalUnlock(hMem);
PostMessage(hwnd,WM_DROPFILES,(WPARAM)hMem,0);
return 0;
}
----------------------------------------------------------
Windowの情報取得
http://mt-soft.sakura.ne.jp/web_dl/vb-parts/myfindwindow/
-------------------------------------------------------------------------
イベントの数々
http://www.river.sannet.ne.jp/yuui/WinDlg/WinMsg.html
http://www.monmon-dance.com/win32api/index.html
---------------------------
ドラッグ&ドロップ イベントのの作り方
http://web.archive.org/web/20040714220349/http://zidney.define.jp/programing/wm/wm_dropfiles/
------------------------------------
ドラッグ&ドロップのサンプル
#include "stdafx.h"
#define MAX_LOADSTRING 100
#include <Windows.h>
typedef struct _DROPFILES {
DWORD pFiles;
POINT pt;
BOOL fNC;
BOOL fWide;
} DROPFILES, *LPDROPFILES;
const char *FileNameList[]={
"C:\\Users\\ookubo\\Desktop\\ivent.vbs",
NULL,
};
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR arg, INT cmdShow)
{
HWND hwnd;
hwnd = FindWindow(NULL,"Adobe Reader");
#if 0
//アプリケーションの終了
if(hwnd != NULL){
PostMessage(hwnd,WM_CLOSE,NULL,NULL);
}
#endif
//ドラッグ&ドロップイベントの作成
// ファイル名の記述に必要なメモリ量を計算
int size=0;
for(int i=0;FileNameList[i];i++)
size+=strlen(FileNameList[i])+1;
size++;
HANDLE hMem=GlobalAlloc(GMEM_ZEROINIT,sizeof(DROPFILES)+size);
char *p=(char *)GlobalLock(hMem);
DROPFILES *DropFiles=(DROPFILES *)p;
DropFiles->pFiles=sizeof(*DropFiles);
DropFiles->pt.x=20;
DropFiles->pt.y=30;
DropFiles->fNC=1;
DropFiles->fWide=0;
p+=sizeof(*DropFiles);
for(int i=0;FileNameList[i];i++){
strcpy(p,FileNameList[i]);
p+=strlen(p)+1;
}
*p='\0';
GlobalUnlock(hMem);
PostMessage(hwnd,WM_DROPFILES,(WPARAM)hMem,0);
return 0;
}
----------------------------------------------------------
Windowの情報取得
http://mt-soft.sakura.ne.jp/web_dl/vb-parts/myfindwindow/
----------------------------------------------------------
マウスのイベント取得
http://ady.at.infoseek.co.jp/app/grmpks.cpp