Click here to Skip to main content
15,909,039 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Database (ACCESS) problem Pin
ansontong27-Dec-03 8:45
ansontong27-Dec-03 8:45 
GeneralTool Tip Drop Shadows Pin
BarryPearlman27-Dec-03 6:54
BarryPearlman27-Dec-03 6:54 
QuestionHow to set font and colours for forms and buttons? Pin
Takhir27-Dec-03 4:24
Takhir27-Dec-03 4:24 
Generalsproxy.exe error with fault element Pin
Anonymous26-Dec-03 23:00
Anonymous26-Dec-03 23:00 
Generalconnection with oracle and sorting the database object as per hierarchal Pin
utkarsharma26-Dec-03 19:21
utkarsharma26-Dec-03 19:21 
GeneralExplain the Output Pin
SiddharthAtw26-Dec-03 18:19
SiddharthAtw26-Dec-03 18:19 
GeneralRe: Explain the Output Pin
Monty226-Dec-03 20:55
Monty226-Dec-03 20:55 
GeneralRe: Explain the Output Pin
VickyMD26-Dec-03 22:15
sussVickyMD26-Dec-03 22:15 
GeneralDestruction of static object Pin
Anonymous26-Dec-03 18:02
Anonymous26-Dec-03 18:02 
GeneralRe: Destruction of static object Pin
Monty226-Dec-03 20:39
Monty226-Dec-03 20:39 
GeneralRe: Destruction of static object Pin
Tim Smith27-Dec-03 3:05
Tim Smith27-Dec-03 3:05 
GeneralRe: Destruction of static object Pin
Gary R. Wheeler27-Dec-03 6:35
Gary R. Wheeler27-Dec-03 6:35 
GeneralRe: Destruction of static object Pin
Tim Smith27-Dec-03 13:27
Tim Smith27-Dec-03 13:27 
GeneralRe: Destruction of static object Pin
Michael Dunn27-Dec-03 7:38
sitebuilderMichael Dunn27-Dec-03 7:38 
GeneralButton Control Pin
Best Friend26-Dec-03 17:13
Best Friend26-Dec-03 17:13 
GeneralRe: Button Control Pin
shultas26-Dec-03 17:52
shultas26-Dec-03 17:52 
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 

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.