|
I think WinTEdit is CDialog if you run this code what happens?
<br />
<br />
if(nChar == 112) {
CWnd *Con = GetFocus();
<br />
WinTEdit *Help;<br />
Help=new WinTEdit(this);<br />
Help.ShowWindow(SW_SHOW);<br />
}<br />
<br />
<br />
WinTEdit::WinTEdit(CWnd* pParent )<br />
: CDialog(WinTEdit::IDD, pParent)<br />
{<br />
Create(WinTEdit::IDD,pParent);<br />
}<br />
|
|
|
|
|
WinTEdit::WinTEdit(CWnd* pParent /*=NULL*/)
: CDialog(WinTEdit::IDD, pParent)
{
Create(WinTEdit::IDD,pParent);
}
causes the same problem
It's seriously possible to open a CDialog in a MDI-Project, or not?
Or isn't it possible to open a CDialog with a "CFormView"-Parent?
So that only the mainform could open the CDialog...
Thanks
-- modified at 3:46 Monday 30th October, 2006
|
|
|
|
|
After call to thread function and then we process some job in main program.
How to check from main program, the thread function is working or not.
|
|
|
|
|
If you still have a handle to the thread, you can call GetExitCodeThread to see if it's still running. If you want to wait for it to finish running, pass the handle to one of the wait functions (e.g. WaitForSingleObject ).
|
|
|
|
|
I use this function..
AfxBeginThread(Thread,this);
for start thread.
Please advise me how to get handle to the thread.
|
|
|
|
|
Something like
CWinThread* pThread = AfxBeginThread(...);
HANDLE hHandle = (HANDLE)pThread;
|
|
|
|
|
Max++ wrote: Please advise me how to get handle to the thread.
They hide that information in the documentation[^]
led mike
|
|
|
|
|
led mike wrote: They hide that information in the documentation[^]
he he he
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
Hi,
I am trying to convert wide character string to ASCII string. I get WideCharToMultiByte() API function to do this task. Now when I am using this function it gives me “ERROR_INVALID_PARAMETER” error. Can I know where I am going wrong?
wchar_t* wStr = L"test string";<br />
int wLen = ::wcslen(wStr);<br />
char* aStr = NULL;<br />
int aLen = ::WideCharToMultiByte(CP_ACP,0,wStr,wLen,NULL,0,NULL,NULL);<br />
int eCode = ::WideCharToMultiByte(CP_ACP,0,wStr,wLen,aStr,aLen,NULL,NULL);
|
|
|
|
|
From the top of my head:
priyank_ldce wrote: char* aStr = NULL;
aStr must point to a valid buffer to recieve the converted multibyte string.
|
|
|
|
|
If I want to use DirectX for writing commercial apps, do I have to pay Microsoft for that. Will it be OK if I buy only Visual Studio 6.
|
|
|
|
|
Using DirectX for a commercial application does not require paying a license.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Daniel Kanev wrote: do I have to pay Microsoft for that
No. Last time I checked, you have to pay ME to do that
|
|
|
|
|
Hi all,
I've a button to move to the next point in a plot
when the button is pushed.
The matter is that i must click on the button many times
if i wanna continue to pass to the next point in the plot,
while i would like to obtain this keeping clicked the button.
How can i do that ?
Thanx in advance,
Desmo16.
|
|
|
|
|
OnButtonDown:
start a timer
OnTimer:
move the selection to the next point
OnButtonUp:
stop the timer
|
|
|
|
|
I suggest you override CButton and create a button class that repeats the BN_CLICKED event.
Have a look at Joe Newcomer's article here[^] for tips on how to accomplish this behaviour.
You could even have more than one timer event to make the BN_CLICKED events generated with higher frequency if the button is kept down for a longer time.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Desmo16 wrote: The matter is that i must click on the button many times
if i wanna continue to pass to the next point in the plot,
while i would like to obtain this keeping clicked the button.
How can i do that ?
Set timer and send BN_CLICKED message from it!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
hi
I want to get the Windows TaskBar Height and Width in MFC.
Any API's are welcome
Thanx in advance
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Hello!
HWND hWnd = FindWindow("Shell_TrayWnd","");
if(hWnd != NULL)
{
RECT rect;
GetWindowRect(hWnd, &rect);
int height = rect.right - rect.left;
int width = rect.bottom - rect.top;
}
modified 8-Mar-17 3:53am.
|
|
|
|
|
I suppose you could subtract the height of the desktop's client area (i.e., SystemParametersInfo(SPI_GETWORKAREA, ...) ) from the height of the screen (i.e., GetSystemMetrics(SM_CYSCREEN) ). The difference would be the height of the taskbar. For an MFC solution, something like:
CWnd *pTaskbar = CWnd::FindWindow("Shell_TrayWnd", NULL);
CRect rc;
pTaskbar->GetWindowRect(rc);
int nWidth = rc.Width();
int nHeight = rc.Height();
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Call SHAppBarMessage(ABM_GETTASKBARPOS) . No sense searching through windows when there's an API that does exactly what you want.
|
|
|
|
|
According to the API description you have to pass the hwnd of your taskbar. :/
SHAppBarMessage(ABM_QUERYPOS, pabd);
pabd
A pointer to an APPBARDATA structure. The uEdge member specifies a screen edge, and the rc member contains the proposed bounding rectangle. When the SHAppBarMessage function returns, rc contains the approved bounding rectangle. You must specify the cbSize, hWnd, uEdge, and rc members when sending this message; all other members are ignored.
Source: msdn
|
|
|
|
|
How can i test with C++ if i had the mode "do not display content while moving windows" in windows desk properties settings.
To get this mode:
-right click on windows desktop, choose general settings
-Tab "appearance"
-clic on Effects.
|
|
|
|
|
Have a look at the MSDN documents for the SystemParametersInfo[^] API - the SPI_GETDRAGFULLWINDOWS flag in particular.
Your code should end up something like this:
BOOL bResult = FALSE;
if( SystemParametersInfo( SPI_GETDRAGFULLWINDOWS, 0, & bResult, 0 ) )
{
if( bResult )
MessageBox( NULL, TEXT( "on" ), 0, 0 );
else
MessageBox( NULL, TEXT( "off" ), 0, 0 );
}
|
|
|
|
|