Click here to Skip to main content
15,891,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralI'm not a programmer, but looking for help Pin
junkyx26-Dec-03 12:26
junkyx26-Dec-03 12:26 
GeneralRe: I'm not a programmer, but looking for help Pin
Marek Grzenkowicz27-Dec-03 1:10
Marek Grzenkowicz27-Dec-03 1:10 
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 
chopeen wrote:
Try to be more precise.

If it is a dialog-based application, you can call Start() method in CYourAppDlg::OnInitDialog().


Sorry i didn't be more precise.

Yes, it is a dialog based application

here is the code that i was calling for the case to start the app when i click Start or Stop ect.,
that is in my "led.c" file
<br />
// 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 />


and this is what it look like when in dialog
http://thanhmai.virtualave.net/led.jpg[^]

and all i want to do it let the Program to run when i open the program.


Thanh
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 
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 

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.