-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
115bc1b
commit 8ea5ac6
Showing
7 changed files
with
200 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/*==================================================================== | ||
* 編集ダイアログ editdlg.c | ||
*===================================================================*/ | ||
#include <windows.h> | ||
#include "resource.h" | ||
#include "strdlg.h" | ||
|
||
|
||
//---------------------------- | ||
// 関数プロトタイプ | ||
//---------------------------- | ||
static BOOL CopyTextToClipboard(HWND hwnd,const char* text); | ||
|
||
|
||
/*==================================================================== | ||
* StrDlgProc() コールバックプロシージャ | ||
*===================================================================*/ | ||
BOOL CALLBACK StrDlgProc(HWND hdlg,UINT msg,WPARAM wParam,LPARAM lParam) | ||
{ | ||
static char str[STRDLG_MAXSTR]; | ||
|
||
switch(msg){ | ||
case WM_INITDIALOG: | ||
SetDlgItemText(hdlg,ID_SHOW_STRING,(const char*)lParam); | ||
lstrcpy(str,(const char*)lParam); | ||
return TRUE; | ||
|
||
case WM_COMMAND: | ||
switch(LOWORD(wParam)){ | ||
case IDOK: | ||
case IDCANCEL: | ||
EndDialog(hdlg,LOWORD(wParam)); | ||
return TRUE; | ||
|
||
case ID_COPY_STRING: | ||
CopyTextToClipboard(hdlg,str); | ||
} | ||
break; | ||
} | ||
|
||
return FALSE; | ||
} | ||
|
||
/*-------------------------------------------------------------------- | ||
* CopyTextToClipboard() クリップボードにコピー | ||
*-------------------------------------------------------------------*/ | ||
static BOOL CopyTextToClipboard(HWND hwnd,const char* text) | ||
{ | ||
HGLOBAL hglbCopy; | ||
char* ptrCopy; | ||
|
||
if(!OpenClipboard(hwnd)) return FALSE; | ||
|
||
hglbCopy = GlobalAlloc(GMEM_MOVEABLE,lstrlen(text)+1); | ||
if(hglbCopy==NULL){ | ||
CloseClipboard(); | ||
return FALSE; | ||
} | ||
|
||
ptrCopy = (char*)GlobalLock(hglbCopy); | ||
lstrcpy(ptrCopy,text); | ||
GlobalUnlock(hglbCopy); | ||
|
||
EmptyClipboard(); | ||
SetClipboardData(CF_TEXT,hglbCopy); | ||
CloseClipboard(); | ||
|
||
return TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/*==================================================================== | ||
* 文字列表示ダイアログ strdlg.h | ||
*===================================================================*/ | ||
#ifndef ___STRDLG_H | ||
#define ___STRDLG_H | ||
|
||
#include <windows.h> | ||
|
||
#define STRDLG_MAXSTR MAX_PATH+256 | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
// ダイアログプロシージャ | ||
extern BOOL CALLBACK StrDlgProc(HWND hdlg,UINT msg,WPARAM wParam,LPARAM lParam); | ||
|
||
#ifdef __cplusplus | ||
} // End of extern "C" | ||
#endif | ||
|
||
#endif |