|
PrashantJ wrote: But I draw other controls like button, edit box, group box, They are not resizable..
My point exactly.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Remove the WS_THICKFRAME style.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
No that didn't work
|
|
|
|
|
On the surface it doesn't make sense, but I recall 'PJ Arends' mentioned something about it in one of his articles, and now I see something similar to it in another article, which is causing me to try and remember the real reason behind its use.
Here's the code.
BOOL CALLBACK CMyApp::searcher(HWND hWnd, LPARAM lParam)
{
DWORD result;
LRESULT ok = ::SendMessageTimeout(hWnd,
UWM_ARE_YOU_ME,
0, 0,
SMTO_BLOCK |
SMTO_ABORT_IF_HUNG,
200,
&result);
if(ok == 0)
return TRUE;
if(result == UWM_ARE_YOU_ME)
{
HWND* target = (HWND*)lParam;
*target = hWnd;
return FALSE;
}
return TRUE;
}
Is there a reason for the reassigning of a value to the same variable in this manner?
William
Fortes in fide et opere!
|
|
|
|
|
You might want to pose this question to Dr. Newcomer.
The only other thing that I can offer is that:
HWND *target = (HWND *) lParam; equates to:
HWND *target;
target = (HWND *) lParam; which is different than:
*target = hWnd;
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Your explanation makes a lot of sense and I believe is the reason for what's being done.
Thanks.
William
Fortes in fide et opere!
|
|
|
|
|
I saw that David explaned that it was not a reassignment.
I hope someone knows the anwser to the implied question: What is the reason behind this?
I consider that more important, because I would have just returned the handle to hWnd or 0, instead of returning TRUE or FALSE. It would have been a lot simpler.
INTP
Every thing is relative...
|
|
|
|
|
John R. Shaw wrote: I consider that more important, because I would have just returned the handle to hWnd or 0, instead of returning TRUE or FALSE. It would have been a lot simpler.
Searcher is an EnumWindows callback function. Nowhere in the documentation (that I could find anyway) do you have access to the return value from the callback function. It is only used by the EnumWindows function as a signal to continue or stop the search. The LPARAM parameter however is guaranteed to be consistant through out the EnumWindows process. The idea behind the code is to return the HWND of the found window to the process that called EnumWindows, and it is done through the LPARAM variable.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote: Searcher is an EnumWindows callback function.
Thanks! I did not think of that.
INTP
Every thing is relative...
|
|
|
|
|
Thanks!
That clears things up.
William
Fortes in fide et opere!
|
|
|
|
|
WREY wrote: HWND* target = (HWND*)lParam; // value assigned to ptr *target = hWnd; // value assigned to ptr AGAIN!
I think he is Indirectly trying to modify lParam.
Owner Drawn
--Nothing special
|
|
|
|
|
Dear All,
I am using the IWebBrowser control as part of my project. My application browses to the internet. Whenever i browse to a certain web site, the url on the address bar does not change to match the current web page.
I am trying to get the current URL using the following method.
CString currentURL = m_webBrowser.get_LocationURL(); (where m_webBrowser is an instance of CExplorer1)
this only works if the url is manually entered in the address bar. however, If a certain web page is pursued through clicks, the above does not give any results.
In a nutshell,
can someone tell me how to retrieve the current URL of a particular web site being browsed ? (in both case, when the url is typed or if resulted from link clicks)
your suggestions would be highly appreciated.
Cheers
llp00na
|
|
|
|
|
Handle the event BeforeNavigate2 of the web browser control..The parameter VARIANT* URL, will give you the url of the page it is going to load....
|
|
|
|
|
I had a similar issue. After installing the VS2005 Pro as well as the VS2005 C++ express, I got a package load error each time I started VS2005 pro OR the vs2005 C++ express editon. I uninstalled and reinstalled several times and got the same result. I also tried using the uninstall exectutable from Microsoft to no avail.
Finally I took the following steps:
1. uninstalled EVERYTHING that had to do with Visual Studio, and .NET components (2.0, 1.1, 1.0), SQL Server and MSDN, MSXML. I mean everything. I followed the uninstall directions given in the dialog after uninstalling Visual Studio and removed/uninstalled the items in the order specified.
2. Then I went to the WINDOWS\assembly directory and deleted EVERYTHING under that directory.
3. I went to "Program Files" directory and deleted everything that had to do with Visual Studio and .NET (2.0, 1.1, 1.0) and SQL Server and MSDN.
4. I also went to the following directories and deleted everything and all directories that had to Visual Studio, SQL Server, MSDN and .NET (2.0, 1.1, 1.0)
"Documents and Settings\<username>\Application Data\Microsoft"
"Documents and Settings\<username>\Local Settings\Application Data\assembly"
"Documents and Settings\<username>\Local Settings\Application Data\Microsoft"
5. Finally I deleted all tempory files in all temporary directories and cleared the internet cache and temporary files using IE
6. I also went to "My Documents" and deleted the Visual Studio stuff there.
After all that I reinstalled VS2005 Pro and VS2005 C++ express and I no longer get the errors.
|
|
|
|
|
I looked for articles on this before asking a question on this
forum. But...
How can I add a local hotkey to an application only? I want to
add the hotkey CTRL + A and I want it to popup a dialog box.
Anyone have any sample code, instructions, or a simple demo
project?
Please, any response any one can give me will be greatly
appreciated.
My email is brinasas@yahoo.com
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
I assume you are talking about an accelerator. If so, you first need to add an entry to the accelerator table. Per MSDN:
1) Select the new-item box at the end of the list.
2) Type the key you want to use as an accelerator. The Accel Properties page appears, with the focus in the Key box.
3) Select an ID from the drop-down list in the ID box.
4) Change the modifier and type, if necessary. The modifier specifies whether the key you chose is a combination formed with CTRL, ALT, or SHIFT. The type indicates whether the key is an ASCII or a virtual key value.
5) Press ENTER.
You'll then need to call LoadAccelerators() to load the table. In your message pump, use TranslateAccelerator() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Take a look at RegisterHotKey, UnRegisterHotKey, WM_HOTKEY.
Happy Programming.
Owner Drawn
--Nothing special
|
|
|
|
|
How do I bold a static text control? Thanks!
|
|
|
|
|
There is a brief example here.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
|
Hi All
I am using "ISO ANSI C++",and i am beginner in C++, and i am working now in console applications , and i want to know if is there any way to control data entry in "ISO ANSI C++"
for example
close all the keyboard except the numerical keys
so user can only add numbers
thx all
|
|
|
|
|
Can you use getchar() for this?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi all,
I am Visual C++ junior in the begginer level. I encounter the problem when using some functions built in c file (such as printf("..."); ....) for my project GUI Visual C++ MFC.
ex: when button is clicked then function prinf("..") will be called. But Errors occur when I build solution.
void CButtonTestDlg::OnBnClickedButton1()
{
printf("test printf used in GUI MFC"); // error here.
}
How can I reuse all functions in c file supplied for specific device by manufacture. Thanks
MilkyWay
|
|
|
|
|
Well, you cannot use printf because there is no standard out in a Win32-based program. You can either use message boxes or change a static text item. You can start by replacing that printf statement with
MessageBox(_T("message box text in GUI MFC"), _T("test"), MB_OK);
|
|
|
|
|
Ah, it helps me a bit. Thank you.
But I have a long list of functions and few external c files.
For example:
my dlgfile.cpp in GUI has
void CButtonTestDlg::OnBnClickedButton()
{int num1 = 5; int num2 = 10; int result; int error =1;
result = sum(num1, num2); //error unresolve external symbol "int .."
result = extern sum(num1, num2); //remove above lin , extern error
//extern displayError(error, result); //erro internal compile
displayError(error, result); //error unresolve external symbol "int .."
}
my ExtFile.c has
int sum(int num1, int num2)
{int SUM;
SUM = num1 + num2;
return SUM;
}
void displayError(int error, int result)
{ printf(sum %d \n"result);
switch (error)
{case 1: printf("error 1"); break;
case 2: printf("error 2"); break;
default: printf("error unknown"); break;
}
}
... other function()
Any ideas thanks.
MilkyWay
|
|
|
|