|
probably the easy way would be to create a modem driver and use the windows PPP and tcp/ip implementations for the connection.
Don't try it, just do it!
|
|
|
|
|
Thanks for your reply. To create a modem driver is really beyond my knowledge now. But I am willing to do it. Do you have any recommended readings or resources on creating modem drivers and windows PPP and TCP/IP?
|
|
|
|
|
the windows DDK (now WDK) is always a good source for driver programming.
you can get a copy via MSDN (subscriber) or via http://connect.microsoft.com
Don't try it, just do it!
|
|
|
|
|
dear all
which keys are available to format our code in editor? it makes easily to read? i mean which keys we can press to format our code? thanks
Li Zhiyuan
|
|
|
|
|
Highlight lines, and press ALT + F8 .
Maxwell Chen
|
|
|
|
|
li zhiyuan wrote: which keys are available to format our code in editor?
Actually all the keys are available.
if you want the shortcut keys search msdn for shortcut keys,
Text Manipulation Shortcut Keys[^]
|
|
|
|
|
Hi,
I am wondering about a way to monitor a process that I create to see if it opens a file and then get the filename. I have no access to the process code itself. I just have the handle to the process.
Thanks,
Clint
csmithmaui
"Turn My Headphones Up!"
|
|
|
|
|
there are ways to do that, but they might be tricky...
one way is polling the open handles of the process with ZwQuerySystemInformation with argument SystemHandleInformation from ntdll.dll.
another way could be injecting a dll to the target process and hooking the api functions (e.g. CreateFileA/W), or creating a device filter driver (which can be very nasty)..
if you don't need this feature permanently in your application (e.g. just for one special case for analysing another application or so), you can use Filemon from www.sysinternals.com.
Don't try it, just do it!
|
|
|
|
|
I know this sounds like a hijack , however I would need to associate my application , with the system-provided , Autoplay notification icon .
In other words is it possible to
1. pop-up a custom menu when the user clicks this icon ?
2. Perform custom actions with each of the menu items ?
I dont want to create another tray icon as my use case is related to this sys tray icon .
eg: When a camera is connected and the icon is present, I would want to provide menu options to open the folder to view the files
Engineering is the effort !
|
|
|
|
|
you could use a windows hook to intersect the window messages sent by the tray icon for example.
Don't try it, just do it!
|
|
|
|
|
hello,
i got an example project from this site that makes window hooks on all windows and add an option at the context menu for traying it.
every window event will fire the following callback function:
LRESULT CALLBACK InitMenuHookProc(int nCode, WPARAM wParam, LPARAM lParam)
I'm needing to do a program that trays windows which title contains "Mozilla Firefox" whenever it's minimized and untrays when it's resized/maximized.
I tried programs like spy++ to get the values of wParam and lParam, but I got completely stuck.
Any help would be appreciated
Best Regards.
|
|
|
|
|
|
also tried that... i would not be asking at forums before searching in google, msdn, etc, but i could not find much information on the subject.
at the code there is:
CWPSTRUCT *wps = (CWPSTRUCT*)lParam;
so i use
if (wps->message==WM_SIZE) {//here should be another instruction to test if the window has been minimized, maximized or restored }
the part of testing this is what i cannot find
BUT i think i can do a workaround on this using wps->hwnd to determine the hwnd state... just need to look out for the right API for this
sorry for bothering and thanks for the time
|
|
|
|
|
marcio k wrote: also tried that
and what happened?
led mike
|
|
|
|
|
I could not found much at microsoft documentation... but this workaround fits like a glove for the problem
|
|
|
|
|
marcio k wrote: but this workaround fits like a glove for the problem
Ah, yes
If it works, do it[^]
led mike
|
|
|
|
|
great pdf!
do someone know any api to get the window state (maximized, minimized, restored) through the hwnd?
thanks
|
|
|
|
|
marcio k wrote: do someone know any api to get the window state (maximized, minimized, restored) through the hwnd?
Umm yeah, the one I already provided to you does.
led mike
|
|
|
|
|
sorry... i was a little "sleep-deprivation drunk" :x
|
|
|
|
|
Hi,
I am trying to create a tray icon. I downloaded Chris Maunder's project and it works for me in my test dialog which is modal. Now I am trying to get it to work in a modeless dialog that ultimately I want to be hidden. I cannot get the tray icon create logic to work. The call to ::Shell_NotifyIcon() fails but I have no idea why. The NOTIFYICONDATA struct seems to be filled in correctly and GetLastError() returns 0. I have tried it with and without a visible modeless dialog. I need the tray icon only to let my user know that my service is running. My code is below:
<br />
m_tnd.cbSize = sizeof(NOTIFYICONDATA);<br />
m_tnd.hWnd = pParent->GetSafeHwnd()? pParent->GetSafeHwnd() : m_hWnd;<br />
m_tnd.uID = uID;<br />
m_tnd.hIcon = icon;<br />
m_tnd.uFlags = NIF_ICON | NIF_TIP;
m_tnd.uCallbackMessage = uCallbackMessage;<br />
_tcscpy(m_tnd.szTip, szToolTip);<br />
<br />
VERIFY(m_bEnabled = ::Shell_NotifyIcon(NIM_ADD, &m_tnd));<br />
Any help appreciated
|
|
|
|
|
Why does the dialog need to be modeless?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This dialog must be modeless because it is to be displayed by a Windows service and I don't want my service to hang or be killed by the OS. This dialog will appear only if the user attempts to shutdown the system if my service is still doing critical processing.
|
|
|
|
|
Royce Fickling wrote: This dialog will appear only if the user attempts to shutdown the system if my service is still doing critical processing.
I've written many Services down through the years and never even considered doing something like that. I'm not even sure if it makes sense in the larger scheme of things. I'm also not sure it is supported during shutdown because as I stated I would never even consider doing something like that.
led mike
|
|
|
|
|
Does GetLastError() give you any useful info?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Not according to his post. I did not find anything on MSDN that says GetLastError() is even used.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|