|
Hello,
INTRODUCTION:
I've derived a CListCtrl in order to be able to edit items, subitems... in order to do so the list control creates at runtime an editbox and a combobox...
Now I create them using the ID's of two existing controls.
I'm sure there must be a solution in order to get free ID's and in order to generate controls using those free ID's.
This is my code:
CRect r;
if (this->m_cedParametritzacio.GetSafeHwnd() == NULL)
{
this->m_cedParametritzacio.Create(WS_CHILD | ES_AUTOHSCROLL,r,this,IDC_ED_PARAMETRITZACIO_LCTRL); <code>Here I use the IDC_ED_PARAMETRITZACIO_LCTRL ID...</code>
}
QUESTION:
Is this possible?
Could you write down a litlle example (little)
Thank you in advance.
|
|
|
|
|
I would suggest to use ::GetDlgItem() to determine if a given ID is used or not.
In pseudo code:
int gnMyCtrlID = ID_WHATEVER;
... some code
if (this->m_cedParametritzacio.GetSafeHwnd() == NULL)
{
while(::GetDlgItem(this, gnMyCtrlID))
gnMyCtrlID++;
this->m_cedParametritzacio.Create(WS_CHILD | ES_AUTOHSCROLL,r,this, gnMyCtrlID);
}
You have also to adapt the message handlers to use this ID.
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
Hi
I am created a electronic device like a joystick now wat i need to do is use this joystick to send messages to games (directx/OpenGL) My joystick currently supports four directions the joystick works OK with the normal window based application like notepad and others but it does not work with games that are created using OpenGL or Directx anyone with an answer or a solution i would be very much thankful
Thanks in advance
bye
Asif Iqbal
|
|
|
|
|
If you really want an answer, please don't post twice the same things. Seems to me like your emulating a driver, or something ? I might write crap, but I don't think that OpenGL or DirectX are the cause of the not functionning of your SendInput, but i think that the games themselves maybe do not use the input stream the same way as "normal" windows based apps. So it seems to me like you will have to write a _real_ driver ...
~RaGE();
|
|
|
|
|
Hi
My project involves sending messages to different windows in the Windows XP environment that is i am communicating with different window by using the SendInput() function now the problem is this that i cannot send messages to games that are developed using OpenGL or Directx All the other application like the windows work all fine I used SendMessage to to an OpenGL game and i havent tried it by sending messages to Directx
based games so isnt SendInput() function powerful enuff to send messages to OpenGL games or directx games please help me out with this problem Thanks in ADVANCE
Ahmed Ajmal
|
|
|
|
|
My program chang windows setting when running,it return this sittng when it has not been active-may be user Alt+Tab
or program termination,my problem is my program consider my help file as new program then it return windows setting while help active?
salah
gis member
|
|
|
|
|
I'm searching for a good reference to include cumulative histograms in my program.
Can anyone help me?
Thanx,
Geert
|
|
|
|
|
How could I manage a app according with the user profile logged in a Server Operational System ??
I need functions to get the current profile name and get the directories of all user profiles.
Thanks,
Cris.
|
|
|
|
|
GetUserProfileDirectory() and GetAllUsersProfileDirectory()
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
"No topic found" for these functions in MSDN Library Visual Studio 6.0. Another idea ??
[]'s
|
|
|
|
|
olhar aqui[^]
Look in the right place
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
Ok, Andreas ... Thanks !!
But, Do you know where could I take the 'userenv.h' file ? And abount Windows CE, these functions have compatibility ?
Thanks a lot ...
Cris.
|
|
|
|
|
You will need to install an more recent Platform SDK to get the right includes and libs.
And for Windows CE, I dont find any reference that these functions are available there. I think that this is only NT/W2k/XP, all others dont manage user profiles AFAIK.
cheers
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
Has anyone coded ro get a Property sheet on the Toolbar. The idea behind this is to categorise the Toolbar buttons and place each category buttons in separate property pages of the PRoperty sheet. This will avoid the expansion of the Tool bar to some extent when new tool bar buttons are added. This feature is available in JBuider or Java Forte IDEs.
Thanks in advance for your response.
Praveen
|
|
|
|
|
I have seen something just like this on CodeProject or CodeGuru a month or two ago. I know it exists, but I can't remember where. I just tried to find it, but didn't have any luck. I'm sure you can find it, just keep searching.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Anybody has an idea on handling a modeless dialog in a console app ?
Jonathan de Halleux.
|
|
|
|
|
As far as i know it is not possible
~RaGE();
|
|
|
|
|
|
Gulp .. did not know about the article ... sorry ...
~RaGE();
|
|
|
|
|
Yep, I had seen this article.
The question is : how can I use cin to get text entry and in the background have modeless dialogs ????
Jonathan de Halleux.
|
|
|
|
|
Create a worker thread in main .
When starting the worker, call CreateDialog to create the modeless as in the article. Then write the message loop and catch there all the messages you throw from the dialog. All this stuff in the worker's handler...
Then you could synchronize the worker with the main , using the system dedicated objects.
Generally, when you call CreateDialog from a thread with NULL as the parent window, the modeless' messages will be droped in that thread's message loop.
rechi
|
|
|
|
|
i have an mfc dialog based app.
in the initInstance function, I'm creating an object of the dialog box (provided by the wizard) and creating a tray icon using NotifyIconData.(without showing the dialog box).
NOW i want to show this dialog box when i right click on this icon but multiple instances of dialog box appear even if i move my mouse over the icon, while i have used WM_LBUTTONDBLCLK in the code below (InitInstance)?
how do i go about it?
this is my src code
CSchdDlg dlg;
m_NotifyIconData.cbSize = sizeof m_NotifyIconData;
m_NotifyIconData.hWnd =dlg.GetSafeHwnd();
m_NotifyIconData.uID = 1;
m_NotifyIconData.uCallbackMessage = WM_LBUTTONDBLCLK ;
m_NotifyIconData.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP;
m_NotifyIconData.hIcon = LoadIcon(IDR_MAINFRAME);
strcpy(m_NotifyIconData.szTip, AfxGetAppName());
Shell_NotifyIcon(NIM_ADD, &m_NotifyIconData);
a quick & detailed response will be heartly appreciated!
thanx
rishabhs
rishabhs
|
|
|
|
|
This is what works for me:
#define UWM_ICONNOTIFY WM_APP+x
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
//...
ON_MESSAGE(UWM_ICONNOTIFY, OnSystemTrayIconNotify)
//...
END_MESSAGE_MAP()
LRESULT CMyDlg::OnSystemTrayIconNotify(WPARAM, LPARAM lParam)
{
switch (lParam)
{
case WM_LBUTTONDBLCLK:
// do something
// etc.
}
return 0;
}
// Initialize system tray icon
//
m_nid.cbSize = sizeof(NOTIFYICONDATA);
m_nid.hWnd = m_hWnd;
m_nid.uID = ID_SYSTEMTRAYICON;
m_nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
m_nid.uCallbackMessage = UWM_ICONNOTIFY;
m_nid.hIcon = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_MYTRAYICON), IMAGE_ICON, 16, 16, 0);
strcpy(m_nid.szTip, "Blah, blah");
Shell_NotifyIcon(NIM_ADD, &m_nid);
HTH
Zdenek
|
|
|
|
|
can u be a bit more specific with ur code.
how to get the :-
ON_MESSAGE(UWM_ICONNOTIFY, OnSystemTrayIconNotify)
in the message map declaration
|
|
|
|
|
I suppose a Class Wizard has created a
BEGIN_MESSAGE_MAP(CYourDialog, CDialog)...END_MESSAGE_MAP()
sequence for CYourDialog.
Using your editor, paste a line
ON_MESSAGE(UWM_ICONNOTIFY, OnSystemTrayIconNotify)
there (for example just below the BEGIN_MESSAGE_MAP() macro line).
Avoid a temptation to put it somewhere between
//{{AFX_MSG_MAP(CYourDialog)
//}}AFX_MSG_MAP
since Class Wizard might get confused.
Insert the declaration of your icon message handler OnSystemTrayIconNotify
into CYourDialog class. Like this:
afx_msg LRESULT OnSystemTrayIconNotify(WPARAM, LPARAM);
That's all.
Zdenek
|
|
|
|