Click here to Skip to main content
15,921,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to intercept tab control creation from a dialog template Pin
Arman S.14-May-07 20:01
Arman S.14-May-07 20:01 
GeneralRe: How to intercept tab control creation from a dialog template Pin
Chilli7115-May-07 1:07
Chilli7115-May-07 1:07 
QuestionVC++ Version Pin
vivekphlp14-May-07 19:37
vivekphlp14-May-07 19:37 
AnswerRe: VC++ Version Pin
Michael Dunn14-May-07 19:52
sitebuilderMichael Dunn14-May-07 19:52 
GeneralRe: VC++ Version Pin
BadKarma14-May-07 20:27
BadKarma14-May-07 20:27 
GeneralRe: VC++ Version Pin
vivekphlp17-May-07 18:09
vivekphlp17-May-07 18:09 
AnswerRe: VC++ Version Pin
Hamid_RT14-May-07 20:48
Hamid_RT14-May-07 20:48 
QuestionHow to show a progress dialog to a no window procedure [modified] Pin
zhongwenjia14-May-07 17:53
zhongwenjia14-May-07 17:53 
this is my test code, it runs good on my computer, but on other computer , can not see the progress dialog,why ?:
(Are there any other methods to show a progress dialog to a no window procedure except multithread?)

////////////////////////////////////////////////////////////////////////////


#include <windows.h>
#include <process.h>
#include <commctrl.h>
#include "resource.h"

/*-------------------------------------------------------------------------*/

#define WM_PROGRESS WM_USER+1

typedef struct
{
HWND hDlg;
HWND hProgress;
HINSTANCE hInst;
}MyParams, *ptMyParams;


/*-----------------------------------------------------------------------*/
BOOL CALLBACK MyDlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
void Thread1(PVOID pvoid);

/*------------------------------------------------------------------------*/
void Thread1(PVOID pvoid)
{
ptMyParams pt=(ptMyParams)pvoid;
DialogBoxParam(pt->hInst, MAKEINTRESOURCE(IDD_DIALOG1), NULL, MyDlgProc, (LPARAM)pt);
_endthread();
}
/*------------------------------------------------------------------------*/
BOOL CALLBACK MyDlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
ptMyParams pt;


switch(Message)
{
case WM_INITDIALOG:
pt = (ptMyParams)lParam;
pt->hDlg = hWnd;
pt->hProgress = GetDlgItem(hWnd, IDC_PROGRESS1);
return TRUE;

}
return FALSE;
}


/*------------------------------------------------------------------------*/

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdshow)
{
static MyParams myParam;
int i;

myParam.hInst=hInstance;
_beginthread(Thread1, 0, &myParam);
Sleep(1000);
SendMessage(myParam.hProgress, PBM_SETRANGE, 0, MAKELPARAM(0, 30));
for(i=0;i<30;i++)
{
SendMessage(myParam.hProgress, PBM_SETPOS, i, 0);
Sleep(20);
}

Sleep(1000);
EndDialog(myParam.hDlg, 0);
return 0;
}



////////////////////////////////////////////////////////////////////////////




-- modified at 1:17 Tuesday 15th May, 2007
QuestionRe: How to show a progress dialog to a no window procedure Pin
Hamid_RT14-May-07 20:54
Hamid_RT14-May-07 20:54 
AnswerRe: How to show a progress dialog to a no window procedure Pin
zhongwenjia15-May-07 1:24
zhongwenjia15-May-07 1:24 
GeneralRe: How to show a progress dialog to a no window procedure Pin
Hamid_RT15-May-07 5:53
Hamid_RT15-May-07 5:53 
GeneralRe: How to show a progress dialog to a no window procedure Pin
Hamid_RT15-May-07 22:00
Hamid_RT15-May-07 22:00 
GeneralRe: How to show a progress dialog to a no window procedure Pin
zhongwenjia15-May-07 23:40
zhongwenjia15-May-07 23:40 
QuestionRe: How to show a progress dialog to a no window procedure Pin
Mark Salsbery15-May-07 5:41
Mark Salsbery15-May-07 5:41 
AnswerRe: How to show a progress dialog to a no window procedure Pin
zhongwenjia15-May-07 23:36
zhongwenjia15-May-07 23:36 
AnswerRe: How to show a progress dialog to a no window procedure Pin
zhongwenjia15-May-07 23:52
zhongwenjia15-May-07 23:52 
GeneralRe: How to show a progress dialog to a no window procedure Pin
Hamid_RT16-May-07 2:08
Hamid_RT16-May-07 2:08 
GeneralRe: How to show a progress dialog to a no window procedure Pin
Mark Salsbery16-May-07 4:59
Mark Salsbery16-May-07 4:59 
GeneralRe: How to show a progress dialog to a no window procedure Pin
Mark Salsbery16-May-07 5:14
Mark Salsbery16-May-07 5:14 
Questionerror C2106: '=' : left operand must be l-value Pin
Aint14-May-07 17:43
Aint14-May-07 17:43 
AnswerRe: error C2106: '=' : left operand must be l-value Pin
bob1697214-May-07 18:14
bob1697214-May-07 18:14 
GeneralRe: error C2106: '=' : left operand must be l-value Pin
Arman S.14-May-07 20:08
Arman S.14-May-07 20:08 
GeneralRe: error C2106: '=' : left operand must be l-value Pin
bob1697215-May-07 2:13
bob1697215-May-07 2:13 
AnswerRe: error C2106: '=' : left operand must be l-value Pin
John R. Shaw14-May-07 19:10
John R. Shaw14-May-07 19:10 
QuestionEvent Handler -Please help me Pin
prathuraj14-May-07 17:08
prathuraj14-May-07 17:08 

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.