Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalfocus different views and timer Pin
(Steven Hicks)n+126-Dec-03 11:19
(Steven Hicks)n+126-Dec-03 11:19 
GeneralRe: focus different views and timer Pin
Monty226-Dec-03 20:59
Monty226-Dec-03 20:59 
GeneralRe: focus different views and timer Pin
(Steven Hicks)n+127-Dec-03 13:15
(Steven Hicks)n+127-Dec-03 13:15 
Generalauto start program when load Pin
Vietnight26-Dec-03 10:57
Vietnight26-Dec-03 10:57 
GeneralRe: auto start program when load [modified] Pin
Marek Grzenkowicz27-Dec-03 1:14
Marek Grzenkowicz27-Dec-03 1:14 
GeneralRe: auto start program when load Pin
Vietnight27-Dec-03 6:37
Vietnight27-Dec-03 6:37 
GeneralRe: auto start program when load [modified] Pin
Marek Grzenkowicz27-Dec-03 20:21
Marek Grzenkowicz27-Dec-03 20:21 
GeneralRe: auto start program when load Pin
Vietnight27-Dec-03 22:33
Vietnight27-Dec-03 22:33 
chopeen wrote:
I guess that this happens when you press the Go button:
case IDSTART:
timerid=timeSetEvent(current->delay,current->delay,TimeProc,0,TIME_PERIODIC);
return TRUE;

Am I right? If yes, put the timerid=timeSetEvent... line in WM_INITDIALOG. You will have something like this:
case WM_INITDIALOG:
timerid=timeSetEvent(current->delay,current->delay,TimeProc,0,TIME_PERIODIC);
return TRUE;

This should do the trick. If it does, let me know. And if it doesn't, you can send me the code and I'll work it out.


Hi chopeen,
Yes, you are right it happen when you press the Go button: i have try to use your method and it didn't work it compile and when i try to run the app i get and Application Error
"The instruction at "0x00401447" referenced memory at "0x00000008". The memory could not be "read".

here is what i add to the code:
switch (message) {<br />
    case WM_INITDIALOG:<br />
        timerid=timeSetEvent(current->delay,current->delay,TimeProc,0,TIME_PERIODIC);<br />
        return TRUE;


maybe i try it again tomorrow, right now is 4:00 AM and i just get back home from work and check the message and try it see it work but not.

here is a block section of the code that the DIALOG INIT

// message loop<br />
BOOL CALLBACK DialogProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
	if(wParam==SYSTRAYBUTTON&&(lParam&3)==3) {<br />
<br />
		Shell_NotifyIcon(NIM_DELETE,&nidata);<br />
		ShowWindow(hDialog,SW_SHOW);<br />
		<br />
		SetForegroundWindow(hDialog);<br />
	}<br />
<br />
    switch (message) {<br />
		case WM_INITDIALOG:<br />
			return TRUE;<br />
		case WM_COMMAND:<br />
			switch(LOWORD(wParam)) {<br />
				case IDRELOAD:<br />
					timeKillEvent(timerid);<br />
					load_cfg();<br />
					curtimes=0;<br />
					curframes=0;<br />
					curtime=0;<br />
					curframe=0;<br />
					change=0;<br />
					timerid=timeSetEvent(current->delay,current->delay,TimeProc,0,TIME_PERIODIC);<br />
					return TRUE;<br />
				case IDHIDE:<br />
					ShowWindow(hDialog,SW_HIDE);<br />
					Shell_NotifyIcon(NIM_ADD,&nidata);<br />
					return TRUE;<br />
				case IDEXIT:<br />
					PostQuitMessage(0);<br />
					return TRUE;<br />
				case IDSTOP:<br />
					timeKillEvent(timerid);<br />
					return TRUE;<br />
				case IDSTART:<br />
					timerid=timeSetEvent(current->delay,current->delay,TimeProc,0,TIME_PERIODIC);<br />
					return TRUE;<br />
				case IDCLEAR:<br />
					timeKillEvent(timerid);<br />
					{<br />
						char *buf;<br />
						buf=calloc(64,1);<br />
						refresh(buf);<br />
						free(buf);<br />
					}<br />
					return TRUE;<br />
				default:<br />
					return FALSE;<br />
			}<br />
		case WM_DESTROY:<br />
		case WM_CLOSE:<br />
			PostQuitMessage(0);<br />
    }<br />
    return FALSE;<br />
}<br />


Thank you the help

Thanh
GeneralRe: auto start program when load [modified] Pin
Marek Grzenkowicz27-Dec-03 22:56
Marek Grzenkowicz27-Dec-03 22:56 
GeneralRe: auto start program when load Pin
Vietnight28-Dec-03 7:05
Vietnight28-Dec-03 7:05 
GeneralRe: auto start program when load Pin
valikac27-Dec-03 5:45
valikac27-Dec-03 5:45 
GeneralRe: auto start program when load Pin
Vietnight27-Dec-03 6:39
Vietnight27-Dec-03 6:39 
GeneralProject always out of date ?! Pin
ldaoust26-Dec-03 10:30
ldaoust26-Dec-03 10:30 
GeneralRe: Project always out of date ?! Pin
ldaoust26-Dec-03 11:15
ldaoust26-Dec-03 11:15 
GeneralHelp, can't resolve an error. Pin
Snyp26-Dec-03 8:28
Snyp26-Dec-03 8:28 
GeneralRe: Help, can't resolve an error. Pin
Michael Dunn26-Dec-03 8:49
sitebuilderMichael Dunn26-Dec-03 8:49 
GeneralRe: Help, can't resolve an error. Pin
Snyp26-Dec-03 9:03
Snyp26-Dec-03 9:03 
GeneralRe: Help, can't resolve an error. Pin
Monty226-Dec-03 21:56
Monty226-Dec-03 21:56 
GeneralUse of MFC Pin
jdgonko26-Dec-03 6:57
jdgonko26-Dec-03 6:57 
GeneralRe: Use of MFC Pin
Ian Darling26-Dec-03 7:40
Ian Darling26-Dec-03 7:40 
GeneralRe: Use of MFC Pin
jdgonko26-Dec-03 8:57
jdgonko26-Dec-03 8:57 
GeneralRe: Use of MFC Pin
Monty226-Dec-03 21:29
Monty226-Dec-03 21:29 
GeneralCImage (the build in atl/mfc class) Pin
loading26-Dec-03 5:13
loading26-Dec-03 5:13 
GeneralMake Static Text (CEdit) to detect mouse click Pin
J.B.26-Dec-03 4:17
J.B.26-Dec-03 4:17 
GeneralRe: Make Static Text (CEdit) to detect mouse click Pin
valikac26-Dec-03 5:37
valikac26-Dec-03 5:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.