home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_C
/
COOLWORX.ZIP
/
DEMO
/
CDLGDEMO
/
CDLGDEMO.C
next >
Wrap
C/C++ Source or Header
|
1994-02-13
|
2KB
|
60 lines
/****************************
* *
* Demo of CoolDialogs *
* Copyright 1994 by AWC *
* *
****************************/
#include <windows.h>
#include "cw.h"
#include "cdlgdemo.h"
/* Text buffer */
char text[128];
/* Copy push button */
BOOL WINAPI _export copyfunc(HWND dlg,UINT wParam,UINT hw,
UINT lw,UINT FAR *sub)
{
SendDlgItemMessage(dlg,EBOX,WM_COPY,0,0);
/* Return focus to edit control */
SetFocus(GetDlgItem(dlg,EBOX));
return TRUE;
}
/* Paste push button */
BOOL WINAPI _export pastefunc(HWND dlg,UINT wParam,UINT hw,
UINT lw,UINT FAR *sub)
{
SendDlgItemMessage(dlg,EBOX,WM_PASTE,0,0);
/* Return focus to edit control */
SetFocus(GetDlgItem(dlg,EBOX));
return TRUE;
}
/* Dialog data template */
DLGDATA(dlgbuf)
DLGITEM(EBOX,sizeof(text),text)
DLGITEM(CM_EDITCOPY,CWDLG_PBUTTONX,copyfunc)
DLGITEM(CM_EDITPASTE,CWDLG_PBUTTON,pastefunc)
DLGEND;
/* Main entry point */
int PASCAL WinMain(HANDLE hInst, HANDLE prev,
LPSTR cmdline, int show)
{
cw_Begin(hInst); // start CoolWorx
/* Show dialog box -- No callback! */
cw_DialogBox(hInst,MAKEINTRESOURCE(MainDlg),NULL,NULL,dlgbuf);
/* Show results using message box */
MessageBox(NULL,text,"Edit control contained",MB_OK);
/* End CoolWorx */
cw_End(hInst);
return FALSE;
}
/* To learn more about writing dialog only programs and other Windows
programming shortcuts -- check out Commando Windows Programming by
Al Williams (published by Addison Wesley). */