|
i wrote an application that do something with the incoming messages via the Windows Messenger Service (net send).
in that i just find the Messenger diaog and then read the mesage frm it and add to my application list control.
for that i uses EnumWindows() and FindWindow()APIS. this will work in all time but when i lock my workstation (using NT/2000) that will not work. i want to add those messages even i lock the workstation...
the problem is we can only use those two API'S based on the desktop window...is any alternate method/ideas?
Thanks in advance,
Regards
Renji
CodeTheDreams();
|
|
|
|
|
service??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
no..notservice...
i just take the message from the netsend dialog by using the EnumWindows() or FindWindow() API. they will work only when the desktop is active. i can't get that when the user lock his workstation.
i want a method which will works even the workstation is in locked state..
thats my requirement..hope that now u got the idea..eh naa..???
CodeTheDreams();
|
|
|
|
|
why dont u make ur application a service, so it works even if the desktop is locked or no one had logged in yet
That's what i meant
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
u man..!!!!!
even now u can't gasp what i am really says..!!!!
U know the netsend.exe ???
eg: netsend papa "hello"
if you sned a message like this will popup a Messenger Service window in papa(machinename /login name).
but this sort of messages while the time of working is so iriitating, so i just write an application to gather the content of the message and add in to a list. tat appplication is wrote as a tray.
the method i used to findout the messenge rpopup window is EnumWinodws() API. this can only enumerate the window(including the messenger window)when the time user works on the machine (that is in the unlocked mode). when the user lock the workstation(ctrl+alt+delete) that api doesnot works....i want an alternative method/idea...
hope that now you got what i am really want..!!!!
thats all aboy that...
regards
renji
CodeTheDreams();
|
|
|
|
|
Dear Friends,
I am using OPENFILENAME to open a file particular .ext file like this....
OpenFileName.lpstrFilter = "XVD files\0*.xvd;0*.vg2";
But along with this I would like to display the list of available files by their name and size too.
But I couldn`t able to do this.
Please write to me immediately.
Thanking You in advance.
So kindly help me to display
|
|
|
|
|
OpenFileName.lpstrFilter = "XVD files\0*.xvd;*.vg2\0All files (*.*)\0*.*\0\0";
|
|
|
|
|
Hi
I want to disable the pasting in a editbox. So Ctrl+V shouldn't work. And in the pop-up menu, paste should be disabled.
Greetings
Jens
|
|
|
|
|
Derive a control from CEdit, handle WM_PASTE, and do not call the base class in the override.
Do you want to generally disable the paste in the menu, or only if the editbox gets the focus ?
~RaGE();
|
|
|
|
|
thank you for the first solution
and i want only to disable pasting when the editbox got the focus.
just modified:
LRESULT CMyEdit::WindowProc(UINT message ...)
{
if ( message != WM_PASTE)
{
return ...
}
}
this works already great, i can not paste by using ctrl+v but the menuitem isn't disabled (but it alsoo doesn't work pasting (that was the intention))
so my problem is solved i guess
Thanksalot
greetings
Jens
|
|
|
|
|
|
dear all,
i want to create checkbox control at runtime and the number of controls can vary everytime the app runs.
i have to do this in either MFC or using win32 api.
is there any sample or links which shows the same.
my main concern is the positioning of the controls and the size of the main window.
any clues!!!!!!!!!
thanx and regards
|
|
|
|
|
|
Greetings. I have an VC++ 6.0 App, and i'm moving to .NET. But i've chosen VC#. My question is. Is it possible to call a VC# dll from the VC++ 6.0 App? If it is, how can i do it? Thank u.
|
|
|
|
|
What you can do is creating a typelib (.tlb) of the C# .dll with tlbexport.exe and access the C#-classes like COM-Objects from within C++.
Regards,
Andre
|
|
|
|
|
Hi!
I am porting a piece of code from a Dialog style program to a SDI one.
There is a GetFont in OnInitDialog, so I put the same GetFont in CView::OnInitialUpdate. But it return a NULL pointer.
It seems CView dont have a default font but dialog take one, isn't it?
|
|
|
|
|
novachen wrote:
It seems CView dont have a default font but dialog take one, isn't it?
Correct. It doesn't make much sense for a CView to have a default font, as what is displayed in the View is completely up to you. If you need GetFont() to work then you need to implement it and return whatever makes sense for your view.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Hi everybody !
I have a dll that 'produces' some objects (through the use of a function). Something that looks like:
HRESULT __declspec( dllexport ) DllGetFactoryObject(CToolFactoryIntfce *& ppObject)
{
ppObject = (CToolFactoryIntfce*) new CToolFactory;
return NO_ERROR;
}
This object (the CToolFactoryIntfce) has his own Release method to destroy itself (delete this). So I when I call Release, the memory allocated by the dll is destroyed by the Dll. So, till now everything works perfectly.
Now, in this object, I have a method that returns a structure containing some data. The structure looks like:
struct TOOL_CONFIG_STRUCT
{
BYTE* pConfigData;
int ConfigSize;
void Clear()
{
pConfigData = NULL;
ConfigSize = 0;
}
void Release()
{
if (pConfigData)
{
delete[] pConfigData;
pConfigData = NULL;
}
delete this;
}
void SetData(void* pData, int Size)
{
if (pConfigData)
{
delete[] pConfigData;
pConfigData = NULL;
}
pConfigData = new BYTE[Size];
memcpy(pConfigData,pData,Size);
ConfigSize = Size;
}
};
The method from the CToolFactory object looks like:
virtual void GetData(TOOL_CONFIG_STRUCT** ppToolData)
{
*ppToolData = new TOOL_CONFIG_STRUCT;
(*ppToolData)->Clear();
(*ppToolData)->SetData(pData,nSize);
};
So, that's for the Dll part. Now, in my main application, I retrieve a CToolFatory object and I call the GetData member function:
TOOL_CONFIG_STRUCT* pNewData = NULL;<br />
pToolFactory->GetData(pNewData);
(pToolFactory is a CToolFactoryIntfce object obtained throug the DllGetFactoryObject function)
That works correctly also! But the problem come when I call the Release function:
pNewData->Release();
It says that the memory was not allocated from the same heap !!!!
Anybody has any idea of what's happening here ??
Thanks a lot
|
|
|
|
|
As TOOL_CONFIG_STRUCT::Release is inlineable, the client app does indeed inline it and thus uses its heap instead of that of the DLL. Declare this method as virtual and you're done.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks a lot!! This works fine
|
|
|
|
|
HI,
I create an windows service in visual C++ 6.0. To install my service i use following command line :
MyService -install
I want to execute this command by program for exemple by a process or Shellexecute function. It's work well but the black command line window always display.
Is there any way to hide this window ?
Thanks in advance
Cheickna
|
|
|
|
|
If you wish to use ShellExecute
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
nShowCmd
If lpFile specifies an executable file, nShowCmd specifies how the application
is to be shown when it is opened. This parameter can be one of the following values:
SW_HIDE Hides the window and activates another window.
SW_MAXIMIZE Maximizes the specified window.
SW_MINIMIZE Minimizes the specified window and activates the next top-level
window in the z-order.
SW_RESTORE Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position.
An application should specify this flag when restoring a minimized window.
SW_SHOW Activates the window and displays it in its current size and position.
SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified
in theSTARTUPINFO structure passed to theCreateProcess function by the
program that started the application. An application should callShowWindow
with this flag to set the initial show state of its main window.
SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.
SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.
SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active window
remains active.
SW_SHOWNA Displays the window in its current state. The active window remains active.
SW_SHOWNOACTIVATE Displays a window in its most recent size and position.
The active window remains active.
SW_SHOWNORMAL Activates and displays a window.
If the window is minimized or maximized,
Windows restores it to its original size and position.
An application should specify this flag when displaying
the window for the first time.
|
|
|
|
|
I would like to know the way to get the size of physical disks (hard disks).
When I use IOCTL_DISK_GET_DRIVE_GEOMETRY, it tells me the size of \\.\physicaldisk0 is 33814126080 bytes = 32247 MB
But actually it is a Maxtor 57GB hard disk, also WIndows Disk Management Tool tells me the size is 55.91 GB.
Could anyone teach me a correct way to get the size of physical disks? Thanks.
BuggyMax
|
|
|
|
|
Does this help???
LPCTSTR lpDirectoryName; // directory name
ULARGE_INTEGER lpFreeBytesAvailable; // bytes available to caller
ULARGE_INTEGER lpTotalNumberOfBytes; // bytes on disk
ULARGE_INTEGER lpTotalNumberOfFreeBytes; // free bytes on disk
lpDirectoryName = "c:";
lpFreeBytesAvailable.QuadPart = 0;
lpTotalNumberOfBytes.QuadPart = 0;
lpTotalNumberOfFreeBytes.QuadPart = 0;
FARPROC pGetDiskFreeSpaceEx;
pGetDiskFreeSpaceEx = GetProcAddress( GetModuleHandle("kernel32.dll"),
"GetDiskFreeSpaceExA");
if (pGetDiskFreeSpaceEx)
{
GetDiskFreeSpaceEx (lpDirectoryName,
(PULARGE_INTEGER)&lpFreeBytesAvailable,
(PULARGE_INTEGER)&lpTotalNumberOfBytes,
(PULARGE_INTEGER)&lpTotalNumberOfFreeBytes);
}
else
{
AfxMessageBox(_T("Error"));
}
|
|
|
|
|
Xander80 wrote:
lpDirectoryName = "c:";
Thanks but "C:" is logical drive. What I need is size of physical disks.
Thanks.
BuggyMax
|
|
|
|