|
You need a Hook to do that. See SetWindowsHookEx
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
The Winamp sample from their site subclasses the Winamp main window. Just follow that and you'll see all messages first, so you can act on WM_CLOSE (or anything else you want) before Winamp sees it.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
Test out a prerelease build of my Hotfix Checker v2.0! (133K)
|
|
|
|
|
I'm not 100% sure this is the right place to post this problem, as it is not programmatic strictly speaking, but anyway...
I've got a program that installs some modem .inf drivers, then creates a dial-up entry and uses it via RasDial . Everything's pretty straightforward and the program runs fine in Win9x. In Windows 2000, however, weird things happen. The program seemed to erratically work or fail to work depending on the drivers I'd previously installed. Finally I isolated the cause of the problem, and it seems to be that, no matter which driver I instruct the dial-up entry to use (with RasSetEntryProperties ), it is the last installed driver which is used. I can check this by enabling logs for the drivers and verifiyng it is actually the last installed modem the one that gets accessed instead of the modem the dial-up entry is set for.
What's even more strange, I'm able to reproduce this exact behavior without using my program, i.e. by creating manually the dial-up entries and double-clicking them. This really strikes me, since it seems too gross a bug to have went unnoticed for so long. Checked MSDN, the web and the Usenet and I've found nothing related to this problem, except the article Q162219, which anyway is about NT4.0 and not 2000.
This is driving me nuts, any idea, suggestion, whatever, will get my eternal gratitude .
Machine is Win2000 spanish version, SP2. Plenty of resources, freshly installed.
If anyone wants, I would gladly send him/her the offending .inf drivers, though I don't think these particular drivers make any difference (who knows, anyway).
Thanks for your help, regards,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Does anyone know how to do a screen grab into a DIB from a CView derived window. I actually do the rendering in the window using OpenGL and I need to display the screen grab of the window in a thmubnail. everything is set up, now I need to get that DIB from the window.
Oh yeah, the other thing is that not all of the windows will be visible, but I still need to grab of the screen as it would appear if it were on top...
can anyone help?
|
|
|
|
|
I want to create an Excel file.
so I use :
hFile=::CreateFile("E:\\my.xls", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
but this file is 0 KB ,
In fact ,EXCEL create a new file is 11kb.
I think ,this file don't contain excel format .
Can you help me ?thank you!
|
|
|
|
|
the file u created is an empty file. .xls if a file format and u need to create ur file in that file format. just by naming a file with .xls extension u cant get an excel sheet. so search creating a file in excel file format
Ganesh Ramaswamy
|
|
|
|
|
If you can ensure excel will be installed on the machine(s) where your program will run, you can use Excel's COM interface to create a new worksheet: (example for Excel 97)
import interfaces (adjust to install path for office)
#import "C:\Program Files\Microsoft Office\Office\MSO97.DLL"
#import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBEEXT1.OLB"
#import "C:\Program Files\Microsoft Office\Office\EXCEL8.OLB" \
rename("DialogBox","_DialogBox") \
rename("RGB","_RGB") \
exclude("IFont","IPicture")
using namespace Excel;
launch Excel, create new workbook
_ApplicationPtr pApp(__uuidof(Application));
pApp->Workbooks->Add();
display to user
pApp->PutVisible(TRUE);
For more information on manipulating Excel via COM, see the MSDN documentation. For more on using the Excel COM interface from Visual C++, see Igor Tkachev's article Using MS Office in an MFC Application.
|
|
|
|
|
Okay it's time to make my Cuestion....
Any body Know which is the service that manage the Shared Directorys????
I have a service that read a shared directory, When the server starts the service can't read the shared directoy. I need to make my service depending of that service...
Thanks....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I think it's the 'Server' service
|
|
|
|
|
I found the service, I need to make my service depending of workstation service....
Cheers!!!!
I'm Happy Again...
Today is Friday!!!
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
SC_HANDLE CreateService(
SC_HANDLE hSCManager, // handle to SCM database
LPCTSTR lpServiceName, // name of service to start
LPCTSTR lpDisplayName, // display name
DWORD dwDesiredAccess, // type of access to service
DWORD dwServiceType, // type of service
DWORD dwStartType, // when to start service
DWORD dwErrorControl, // severity of service failure
LPCTSTR lpBinaryPathName, // name of binary file
LPCTSTR lpLoadOrderGroup, // name of load ordering group
LPDWORD lpdwTagId, // tag identifier
LPCTSTR lpDependencies, // array of dependency names
LPCTSTR lpServiceStartName, // account name
LPCTSTR lpPassword // account password
);
You have to specify dependencies in the lpDependencies parameter.
Martin
|
|
|
|
|
Carlos Antollini wrote:
I found the service, I need to make my service depending of workstation service....
Like a few others already have said, it's actually the server service.
The server service handle NETBIOS, which makes other computers able to access your shares, and makes you able to access shares, and a lot of other stuff...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
shares are handled by the "Server" service.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hello,
How it is possible to delete a CWinApp object (theApp) programmatecally???
I explain my problem:
My main programm is a console programm (then it use no frame).
When a user type a command in the console, the main programm create a CWinApp
object and build a CMainFrame object using a DLL.
To close the main frame (ie the CMainFrame object), the user use a menu option
and I send a WM_CLOSE message to CMainFrame.
CMainFrame is correctly destroyed, but the CWinApp object is not deleted...
How it is possible to delete a CWinApp object (theApp) programmatecally???
Thks,
PK
|
|
|
|
|
Hello Everybody,
my problem is the following: I have create a Splietted View.
I would like to hide or show the second row simply cliccking a toolbar button.
How can I do that?
Have a good day
|
|
|
|
|
Any tip / sample code ?
Thanks in advance.
Miroslav Rajcic
|
|
|
|
|
Try this:
BOOL SHGetPathFromIDList(LPCITEMIDLIST pidl,LPTSTR pszPath);
and then
DWORD WNetGetUniversalName(
LPCTSTR lpLocalPath, // path for network resource
DWORD dwInfoLevel, // level of information
LPVOID lpBuffer, // name buffer
LPDWORD lpBufferSize // size of buffer
);
Regards,
Martin
|
|
|
|
|
Thanks!
First one now works good enough for me.
Regards,
Miroslav Rajcic
|
|
|
|
|
Hello everyone!
I have one silly question.
::SendMessage(::GetDlgItem(m_hWnd, IDC_LIST), LB_ADDSTRING, 0, (LONG) achKey);
This ^^^^ adding string to a listbox.
How can I do same thing for Control List?
==============
www.design.kg
|
|
|
|
|
If you mean a ListView control, look up LVM_INSERTITEM on MSDN.
Michael
|
|
|
|
|
Hi all, I`ve managed to load a bitmap as a DIBSection and have kept the HBITMAP structure (I haven`t attached it to a CBitmap). However, now I want to serialize the bitmap in the widely used bitmap format. Currently I create a CFile object to the location I want to save, with the flags modeCreate | modeWrite, I then create a CArchive and set it to ::Store using this newly created file. I then attach my HBITMAP to a CBitmap object and call the serialize function. The "bitmap" is created in the location specified but its 0 bytes big, so I don`t think the CBitmap serialize is working, any ideas on how to solve this would be much appreciated,
Cheers Guys,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Bitmaps do not support serialisation. Look at the bitmap section on Code Project for several classes to save bitmaps, also my GDI+ articles, and the FAQ lists several other options
Only a master of evil, Darth - Obi Wan Kenobi
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Thanks Christian, I thought this question would be right up your alley! I like the return quote too, it humoured me quite a bit.
Cheers again Christian,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
I`ve checked the codeproject web-site and found a CxImage wrapper, which does serialisation amongst many other stuff. However I find it incredibly difficult to read (as its a multi-project thing with passwords etc.), but its too complex. It uses a FILE structure (of which I know nothin about) and fwrite. I was wanting to use CArchive's << operators (I know a tincy wincy thing about them), but I need to know which order to iterate through each member variable, does anyone know this? or can someone advise on a better approach (I just need a little kick in the right direction, cos I`m not sure what I`m doing at the moment ) Is GDI+ the way to go Christian?
Thanks guys,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
is that u have a proper HBITMAP and u want to persist this bitmap, if so refer MSDN Platform for storing bitmaps and it has a sample code. copy and paste ( if u dont wnat to understand ) and u r done ( ofcourse u have rename the variables )
Ganesh Ramaswamy
|
|
|
|
|