|
There are two listboxes in my app. When you click on an item in listbox 1, a list of possible options appears in LB 2. You can check these and select some. So each item in LB1 has a set of options from LB2. What I want to do is have a menu item. When you click on this menu, I want the dropdown menu to have a list of the items from LB1. When I click on any submenu item (item from LB1), I want a sub-sub menu (the one that pops up to the side) to show up with the options for that item from LB 1.
Is it possible to have this sort of menu get created? So far I've only made menus in the menu editor. Here the main menu item called "List Search Criteria" will be made by me in the editor, but when I click on it, I want the selections of the user to show up. Of course until the user has selected something, this menu item should be unresponsive. SO maybe it can say "nothing selected" or something.....
Any hints and functions that can be used to do this will be greatly appreciated.
Thanks,
Appreciate your help,
ns
|
|
|
|
|
Look up the menu APIs, they're quite easy. CreatePopupMenu, InsertMenu, AppendMenu, etc.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hello,
INTRODUCTION:
1. I'm trying to install a system wide keyboard hook in order to avoid some keystrokes.
2. I've implemented that static callback f(x) inside a DLL.
3. I call the DLL exported function from a service.
4. I'm sure that the service works right. (it's a SERVICE_WIN32_OWN_PROCESS service).
5. It seems that the callback function that has the hook it's called only one time!.
PROTOTYPE:
static LRESULT CALLBACK HookTeclatLL(int nCode,WPARAM wParam,LPARAM lParam);
CALL
hHookTeclat = SetWindowsHookEx(WH_KEYBOARD_LL, HookTeclatLL, hInstDLLSCT, NULL);
return (hHookTeclat != NULL); <code>the return value is not NULL</code>
CODE:
static LRESULT CALLBACK HookTeclatLL(int nCode,WPARAM wParam,LPARAM lParam)
{
if (nCode == HC_ACTION)
{
switch (wParam)
{
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
case WM_KEYUP:
case WM_SYSKEYUP:
{
LPKBDLLHOOKSTRUCT p = (LPKBDLLHOOKSTRUCT)lParam;
bool bDeleteKey = false;
bDeleteKey = ((p->vkCode == VK_RWIN) ||
(p->vkCode == VK_LWIN) ||
(p->vkCode == VK_ESCAPE) ||
(p->vkCode == VK_F1) ||
(p->vkCode == VK_F2) ||
(p->vkCode == VK_F3) ||
(p->vkCode == VK_F4) ||
(p->vkCode == VK_F5) ||
(p->vkCode == VK_F6) ||
(p->vkCode == VK_F7) ||
(p->vkCode == VK_F8) ||
(p->vkCode == VK_F9) ||
(p->vkCode == VK_F10) ||
(p->vkCode == VK_F11) ||
(p->vkCode == VK_F12) ||
(p->vkCode == VK_CANCEL) ||
(p->vkCode == VK_RBUTTON) ||
(p->vkCode == VK_PAUSE) ||
(p->vkCode == VK_SNAPSHOT) ||
(p->vkCode == VK_APPS) ||
(p->vkCode == VK_SCROLL));
if (!bDeleteKey)
{
if ((p->flags & LLKHF_ALTDOWN) != 0)
{
bDeleteKey = (p->vkCode == VK_TAB);
}
if ((p->flags & MOD_WIN) != 0)
{
bDeleteKey = true;
}
}
if (bDeleteKey)
{
logEstat("\nELIMINANT\n"); <code>In order to monitor only</code>
MessageBox(NULL,"ELIMINANT","",MB_SERVICE_NOTIFICATION); <code>In order to monitor only</code>
return 1; <code>this should remove the key pressed...</code>
}
break;
}
}
}
return CallNextHookEx(hHookTeclat, nCode, wParam, lParam);
}
Do you know anything that I'm missing or that I have misunderstood or something?
The problems are:
1. I think that only one time its called that static callback f(x).
2. the keys are not removed.
3. It seems that the messageboxes never appear... even with the MB_SERVICE_NOTIFICATION...
Thank you in advance.
|
|
|
|
|
I have figured it out...
The service must be interactive in order to be able to install a keyboard hook.
|
|
|
|
|
I have a problem when i create a NT Service that is based on a MFC SDI application.
The application uses the CNTService from the sample from Nigel Thompson.
The problem is that i can't get the GUI to work correct and the GUI are not shown when I log on to my computer.
|
|
|
|
|
I'm new to services, but have you set m_dwServiceType to SERVICE_INTERACTIVE_PROCESS?
Hope this helps.
|
|
|
|
|
I allready have this flag set so that dosen't help.
|
|
|
|
|
You must to set the service in Interactive mode.
Best Regards.
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hi,
How can I "lock" toolbars and controlbars in place in an application, so the user can resize them, but cannot move them around?
Thanks!
"No one goes to hell because of their sin, but because of rejecting God's method of salvation: His Son's life for yours..."
"It does not take a majority to prevail ... but rather an irate, tireless minority, keen on setting brushfires of freedom in the minds of men." --Samuel Adams
|
|
|
|
|
I have to use an application that uses DAO interface
on a machine (WINNT 4.0) where Access is not installed.
What have I to do in order to let this application work ??
I know that DAO350.DLL and/or DAO360.DLL files must be installed
in the machine, but, is required only files presence or they
must be registerd in the system registry ??
How can I install that DLLs ???
Thank a lot !!!!
|
|
|
|
|
NO, you need a list of several libraries, like jet librarys, error librarys, etc.
Check in your last cd of the Visual Studio 6.0, you will can find the Dao SDK,
into it you will can find a simple installer for dao libraries. I don't remember the name of the package y remmber that have a size of 4 or 5 MB...
Best Regards
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hello,
I have a problem with pointers.
I want to convert a static array to a dynamically created one. With one dimension, this is easy:
unsigned char array[8000];
would be
unsigned char *array = NULL;
...
array = new unsigned char[8000];
...
delete []array; array = NULL;
This is easy. But how do I convert a static array which has
more than one dimension, lets say 2?
unsigned char array[100][100];
would be what?
-Dominik
|
|
|
|
|
depends:
1. //unsigned char array[100][100];
unsigned char** array = new char [100][100];
...
delete []array; array = NULL;
2. //unsigned char array[100][100];
unsigned char** array = new char* [100];
for(int i = 0; i < 100;++i)
array[i] = new char[100];
...
for(int i = 0; i < 100;++i)
delete[] array[i];
delete []array; array = NULL;
|
|
|
|
|
Works
Thank you very much!!!
-Dominik
|
|
|
|
|
imagine you are coding amutithreads server so all client you create a socket and a new threads to handle the connexion
so imagine that your program is a chat program.
my problem is that i would like to know how can you do for the public message.Indeed one of your threads migth receive a message and how can you talk to other threads containig the connexion , to send the message to ii socket.
So that all other client will receive the message reacieved by this thread's connexion.
if you think that you can't , that means that you can : if you understand this there youn can
|
|
|
|
|
|
please can you be more relevant please i'm so confious may be a piece of code
if you think that you can't , that means that you can : if you understand this there youn can
|
|
|
|
|
MSDN : MultiSoc : Illustrates Using Sockets in Multiple Threads
MSDN(SDK) : Power Outlets in Action: Windows Sockets
|
|
|
|
|
MSDN: CHATSRVR Sample: Demonstrates a Windows Sockets Server
|
|
|
|
|
i did not find the mutliSoc article can you give me the link please
if you think that you can't , that means that you can : if you understand this there youn can
|
|
|
|
|
http://download.microsoft.com/download/vc60pro/Sample4/1/WIN98/EN-US/MultiSoc.exe
|
|
|
|
|
The problem is that all data that i save in the registry is gone after windows (2000) is restarted. All data appears to be ok after the application closes. But after the restart the key is completely gone.
The code used in the app:
Opening the key:
HKEY hKeyRoot = HKEY_CURRENT_USER;
LPCTSTR pszPath = "Software\\Companyname\\My App Name\\Settings"
HKEY hKey;
DWORD dw;
RegCreateKeyEx(hKeyRoot, pszPath, 0L, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dw);
Writing:
int iValue = 8;
LPCTSTR pszKey = "MyInteger";
hKey as returned by RegCreateKeyEx
RegSetValueEx(hKey, pszKey, 0L, REG_DWORD, (CONST BYTE*)&iValue, sizeof(int));
Does anyone know how to prevent this and why it happens?
Thanks
I'm smart enough to know that i'm stupid and i'm stupid enough to think that i'm smart
|
|
|
|
|
you must change the REG_OPTION_VOLATILE to KEY_ALL_ACCESS.
Hope this helps...
|
|
|
|
|
The KEY_ALL_ACCESS is the next argument
|
|
|
|
|
I must sleep more! sorry...
|
|
|
|