|
hi,
Think i was not very clear about what i actually wanted.I know that WM_MOUSEFIRST..WM_MOUSELAST are from mouse and WM_KEYFIRST..WM_KEYLAST are from keyboard.But suppose there is an option in menu which can be selected through keyboard and mouse and the same option is available as a button on toolbar and i'm calling a common function after the option is selected,then how do i determine that the option was selected through keyboard or mouse.besides are these key and mouse events fired for accelerators as well?
thanx,
viraj
|
|
|
|
|
You can use wParam and lParam accompanying WM_COMMAND message to determine if it came from accelerator or menu. Have no idea about toolbar, however.
If you want to perform different actions for menu/toolbar/accel selection, why don't you assign different command IDs?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
I have Main window.Inside that main window there are many child windows.but if i click any child window,the window title bar is not blue in color,but i can move the child window and the messages are received.But my title bar is not showing that it is active.How to make active when i just click on the title bar.
|
|
|
|
|
I have a MFCGridCtrl in a CFormView. I want to enable tooltips for the column header of the Grid when mouse moves over it. Currently, tooltip is displayed by default when textsize exceeds column width. But I want to have it always(evenif column width is more). Can anyone help me.. its too urgent..
|
|
|
|
|
|
Hi All,
I need to enable the option of password meets complexity under the password policy of the windows 2000 programmatically.How do I do this task.
Is there any API available.
Kindly Help.
Thanks
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
You mean, must be six characters long ? How do you have it stored ? All string classes have some sort of length function. If you want numbers AND letters, you'll have to iterate over the string looking for both.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I'm not taking the password programmatically.I need to enable the option in the Windows 2000 settings programmatically.The setting is in the Administrative Tools,which I need to enable thru my program.
Learning is a never ending process of Life.
|
|
|
|
|
Hi, I have a little system tray application. Now I need to add a options dialog and I also like to give it a hotkey.
How can I add a accelerator to my main frame? I never did this before. When a hotkey is pressed it should send a WM_COMMAND (wParam ID_APP_OPTIONS) to my main frame (which then will create the dialog).
Thanks for help!
|
|
|
|
|
There should be an accelerator table in your ResoureView tab. Use the editor to add a new key with the id ID_APP_OPTIONS. If there isn't a table there, add one and make sure its id is IDR_MAINFRAME.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
i have an int and i want to convert it int CString and write it into a file through CFile or file pointer how to write it?
any body plz write the complete syntex of it ?
r00d0034@yahoo.com
|
|
|
|
|
CString s;
int i = 0;
s.Format("%d", i);
CFile, you're on your own. MFC file stuff is crap, I use iostreams.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
One solution for writing a CString to a file using MFC is CStdioFile.
CStdioFile output(filename, CFile::modeWrite | CFile::modeCreate);
output.WriteString(CStringObject)
Kuphryn
|
|
|
|
|
Please help me hoe to Override ExitInstance() in VS.net?
|
|
|
|
|
you could write an addin for VS.NET and act on the
OnBeginShutdown event.
But I don't think it's possible to override ExitInstance directly.
|
|
|
|
|
any body tell me how to convert a int into CString
so that i can seen the character of int ?
any body tell me how to convert a int into String
so that i can seen the character of int ?
r00d0034@yahoo.com
|
|
|
|
|
CString s;
int i = 82;
s.Format("%i",i);
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
im developing with visual c++.net.. and am wondering how to set the background of a label so that it is transparent.
xai
|
|
|
|
|
ummm, sorry
from->BackColor = Color::Transparent;
i should have known..
xai
|
|
|
|
|
I got some weird bug on my system where it keeps doing a reboot (not BSOD). Is there a way to track which process is calling InitiateSystemShutdown?
This is weird. I found this in Event Viewer
The process winlogon.exe has initiated the restart of WS-176 for the following reason: No title for this reason could be found
Minor Reason: 0xff
Shutdown Type: reboot
Comment:
Todd Smith
|
|
|
|
|
|
Right click on the solution name or sub-project name in the Solution Explorer and select 'Rename'.
Or, select the desired item and change it's name in the property window.
Nick
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2002 Microsoft Corporation. All rights reserved.
|
|
|
|
|
First, I have read all the post concerning plugins. Most tell you to use COM. So lets start with NO COM. Please. I have 3 functions I want to support dlls in. They are all simple functions, pass data, get data back. I only need one dll per function to be loaded at a time. The dll's will need to register themselves on install, and the user can select what dll they want to use. What is the simplest way to do this. I was once told that as long as you keep the same functions exported in each dll, same input/output data types, that all you need to do is to load whatever dll you want. Please confirm this. OK I will digress to keep this from getting to long. Please help.
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
Darroll wrote:
I was once told that as long as you keep the same functions exported in each dll, same input/output data types, that all you need to do is to load whatever dll you want
Yes. Use LoadLibrary with correct path, then GetProcAddress with function name.
Of course, there's number of things to remember - for example, if you're linking statically with CRT, then your dll shouldn't free blocks allocated in exe and vice versa.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Darroll wrote:
I was once told that as long as you keep the same functions exported in each dll, same input/output data types, that all you need to do is to load whatever dll you want.
Yes, that's right. You can load the DLL chosen at runtime using LoadLibrary. Instead of registering the DLLs, I scan a program directory for DLLs at startup using Version Info resource to sort the DLLs by categories.
Example:
typedef int (CALLBACK* LPDLLMYFUNC)(char *data);
...
HINSTANCE hDLL = LoadLibrary(dllpath);
int res;
char data[] = "bflmpsvz";
if (hDLL != NULL)
{
LPDLLMYFUNC lpfnDllFunc = (LPDLLMYFUNC)GetProcAddress(hDLL,"MyFunc");
if (lpfnDllFunc)
{
res = lpfnDllFunc(data);
}
FreeLibrary(hDLL);
}
You need to export the function int MyFunc(char *data) from your DLL.
Pavel
Sonork 100.15206
|
|
|
|