|
Whether is his meaning ON_WM_MOUSEMOVE/WM_MOUSELEAVE messages on slider movement .
|
|
|
|
|
I am not sure how to obtain, set or get the WM_SETFOCUS messages from Dialog item.
Scott Dolan
Jernie Corporation
Engineering & Manufacturing
Software, Hardware, & Enclosures
|
|
|
|
|
You stated you wanted to know if the control was "selected" so hopefully that means you need to
know when it gets focus (like when you tab to a control in a dialog).
If so, you could...
In MFC, derive a class from CSliderCtrl and add a handler for WM_SETFOCUS.
For non-MFC, subclass the trackbar control and look for the WM_SETFOCUS message there.
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Why don't you cast the pScrollBar parameter pass with the OnHScroll to CSliderctrl..
void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
{
// TODO: Add your message handler code here and/or call default
int nControl=pScrollBar->GetDlgCtrlID();
CSliderCtrl* pControl= static_cast<csliderctrl*>(GetDlgItem(nControl));
switch (nControl)
{
case IDC_SLD_CTRL:
{
}.
.
.
.
.
|
|
|
|
|
Hello,
I am planning to write a program that will do string find and replace for any text file. Can anyone one give me any suggestion what is the best way to do it, or is there any existing library already provide this feature? I can write my own but it may not be efficient enough. Any suggestion? Thanks!
Nacho
Nacho
|
|
|
|
|
may be you can find good example if you look into the souce code of the CString::Replace();
|
|
|
|
|
There is shell script to do string find and replace for any text file in liunx . You can find the code of liunx , may be help to you .
|
|
|
|
|
Can this help to start?
http://www.codeguru.com/forum/showthread.php?t=426623&highlight=functions
|
|
|
|
|
Hello,
In my program I have a variable which stores hwnd of a window. In order to close that window I use Postmessage and WM_Close but there is a problem. When the program is launched second time hwnd of the window that was closed is the same and the window is not shown at all. Consequently IsWindowVisible returns false for that window. I decided to use Showwindow to make that window visible but it doesn't work. After executing Showwindow(hwnd,1) Iswindowvisible returns true but that window is still not shown. So is there a way to make invisible window visible or to close it in such a way that when it is initialized second time it is visible. Thanks
|
|
|
|
|
Giorgi Dalakishvili wrote: When the program is launched second time hwnd of the window that was closed is the same
There's no guarantee the HWND will be the same the next time you run an application, so comparing
the HWND to the one in a previous instance is irrelevant.
If you meant "When the window is launched second time ..." then -
If the default window proc for the window handled the WM_CLOSE message then DestroyWindow() has
been called on the HWND so it's no longer valid. In that case, you need to create a new window,
which possibly will have a different HWND.
It's up to you to keep track of the HWND
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Mark Salsbery wrote: There's no guarantee the HWND will be the same the next time you run an application, so comparing
Yes I know but in my case it is the same.
Mark Salsbery wrote: you meant "When the window is launched second time ..."
No I didn't
|
|
|
|
|
CreateWindow(Ex) is being called the second time and succeeding?
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
wait what about:
Giorgi Dalakishvili wrote: Yes I know but in my case it is the same.
|
|
|
|
|
The plot thickens...
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Mark Salsbery wrote: CreateWindow(Ex) is being called the second time
No, it isn't. Actually, it is a .NET application using dllimport to access winapi functions. I have a notifyicon and in the balloontipshown eventhanler I use findwindow to find hwnd of the balloon tip. Every time I launch the application, the hwnd of balloon tip is the same. Of cource it changes after restarting windows or explorer.exe
|
|
|
|
|
Wow...I was sure thinking in a different direction
The second time your app runs, try calling ::IsWindow(hwnd) on the HWND.
Is it valid or have you destoryed another processes window?
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Mark Salsbery wrote: The second time your app runs, try calling ::IsWindow(hwnd) on the HWND.
I'll do it this evening.
I have noticed that when I use showwindow to make the balloon tip visible, it is shown but only part of its border and very unclearly. So I suspect that when I close it by sending wm_close button I destroy all its properties including styles and all the stuff so maybe I need to set style for the balloon tip during runtime?
|
|
|
|
|
Yes, posting a WM_CLOSE message to a window, by default, causes the window to be destroyed.
Can't you just use ShowWindow(SW_HIDE) instead of destroying the window?
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
I thought about it but it leaves some trace like the one when you close the balloon tip and a little part of it is still visible. Is it possible to set cursor position at the x button of balloon tip and click it programmatically?
|
|
|
|
|
hi all i want to make Toolbar for Fire Fox, i have search but found nothing related to the its development with microsoft technologies, is is not possible to do so with microsoft technologies VC++ or .net
Regards.
Tasleem Arif
|
|
|
|
|
_tasleem wrote: i have search but found nothing related to the its development with microsoft technologies
They hide that information in the documentation[^]
|
|
|
|
|
led mike wrote: They hide that information in the documentation[^]
Bastards.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Provided the fact that Firefox uses its own framework and hence extension mechanism are really specific and customized to that framework, I am not sure how using VS IDE will help more than the specialized tools provided by Firefox to do the job.
Following link should help.
http://www.devsource.com/article2/0,1759,1995990,00.asp
But also take a note of the authors blog
http://www.amazon.com/gp/blog/post/PLNK2OLL1EDO876SB
Regards
|
|
|
|
|
I was looking to run a function after OnInitDialog completes and has fully drawn the dialog to the screen. I am getting some good results using this method, however, not all of the dialog objects and dialog are showing up. Not to sure why either.
// stdafx.h
#define WM_MY_USER_DEFINED_MESSAGE WM_APP + 0x10
// MyDialog.h
virtual BOOL OnInitDialog();
afx_msg LRESULT OnMyUserDefinedMessage(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
// MyDialog.cpp
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
ON_MESSAGE(WM_MY_USER_DEFINED_MESSAGE, OnMyUserDefinedMessage)
END_MESSAGE_MAP()
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
PostMessage(WM_MY_USER_DEFINED_MESSAGE);
return TRUE;
}
LRESULT CMyDialog::OnMyUserDefinedMessage(WPARAM wParam, LPARAM lParam)
{
//I would imagine that if we are here, the dialog has completley drawn by now.
//but this does not seem to be the case
Sleep(5000);
AfxMessageBox(L"ok");
return NULL;
}
|
|
|
|
|
Hey,
Just force it by calling the ShowWindow function right before you call return:
ShowWindow(SW_SHOW);
This will force the window to be displayed.
Cheers ...
|
|
|
|