|
How do I find out what are the browers installed on my system ?
Is there any key in the registry which contains a list of the browsers or do I have to find out individually ?
Thanx,
Santhosh Kumar S
|
|
|
|
|
Hi everyone,
I have a project that is MFC based and I would like to know how I can display the value of an COleVariant variable in a messagebox?
For example, I have the following:
COleVariant var;
var then contains some data. I retrieved from a database with GetFieldValue() function. which is done with a CDaoDatabase connection.
How do I display whatever that is in var in the MFC application to see what is inside it?
If anyone knows, Please let me know.
Thanks in Advance!
Steve
|
|
|
|
|
Does anyone have a macro or function for converting a 24-bit RGB-color to a 16-bit (5.6.5) color?
Thanks in advance!
Erik
|
|
|
|
|
( (GetRValue(cr) >> 3) << 11 ) |
( (GetGValue(cr) >> 2) << 5 ) |
(GetBValue(cr) >> 3)
|
|
|
|
|
Thanks a lot!
What about 16-bit 1.5.5.5 translation?
Thanks again.
|
|
|
|
|
Has anybody managed to do these (like in the MS Development Environment program). I.e users can tear off tabs and/or re-arrange them.
Or, are there any existing libraries, etc, that can do this.
Thanks in advance,
James
|
|
|
|
|
As the title says, I have some code that implements tear-off tabs, very similar to the MDE IDE in faact (down to the pixel). The problem is that it isn't fineshed. The major drawbacks at the moment are:
1] Un-Docking one tab from a tabbed window undocks them all.
2] Re-Docking does not ALWAYS work (will crash sometimes).
3] Requires the BCGControlBar library (72 or later) (see this site for the download detailes - it is free).
On the other hand, the tabs/docking dialogs DO:
1] Allow rearranging by dragging the tab left and/or right.
3] Allow hosting of any CWnd derived class.
All this said, I would be willing to let you (or anybody else) have a look at the code and see if you can make anything out of it. Who knows, maybe you (or anybody else) will solve the problems *HINT* .
If you are interested, email me at:
dwulff@battleaxe-software.co.uk
Yours,
David
|
|
|
|
|
|
Hi,
In one of my programs, i am using system-wide keyboard hooks. However, i have some problems:
1)Sometimes, my program is not notified about the keypress event. For example when i press 'i' key while using ACCESS, my program is not notified.
2)Sometimes, the program gets two notifies instead of one. For example, when i press a key on MSDN, the program thinks that i pressed the same key two times.
The source code of .dll is the following:
<br />
#define ID_CMD_KEYPRESSED WM_USER+200<br />
HWND ghWndMain;
static HHOOK hHook;
static BOOL bHookInstalled;
<br />
HINSTANCE ghDLLInst; <br />
SYSTEMHOOK_API LRESULT CALLBACK KeyboardProc(<br />
int code,
WPARAM wParam,
LPARAM lParam)
{<br />
if (code>=0) <br />
{<br />
if (HIWORD(lParam) & 0x8000) <br />
{<br />
HWND h=::FindWindow(NULL,"WinScheduler");<br />
PostMessage(h, ID_CMD_KEYPRESSED , wParam, lParam);<br />
}<br />
} <br />
return (int)CallNextHookEx(hHook, code, wParam, lParam); <br />
}<br />
SYSTEMHOOK_API int WINAPI InstallHook (HWND hWnd, BOOL bCode )<br />
{ <br />
int nReturn = 1;<br />
ghWndMain = hWnd;
<br />
if (bCode == bHookInstalled) <br />
return 0; <br />
<br />
if (bCode) <br />
{ <br />
hHook=(HHOOK)SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KeyboardProc,ghDLLInst,0); <br />
if (!hHook) <br />
return 0; <br />
bHookInstalled = TRUE; <br />
} <br />
else <br />
{ <br />
nReturn = UnhookWindowsHookEx(hHook); <br />
bHookInstalled = FALSE; <br />
} <br />
return nReturn; <br />
}<br />
If anyone knows what the problem is, please help me.
Secondly i want to ask a question about sending keystrokes:
I use
void keybd_event( <br />
BYTE bVk,
BYTE bScan,
DWORD dwFlags,
DWORD dwExtraInfo
); to send keystrokes to other applications. However, i cannot send some special characters like .,!'^+%&()=. How can i send these characters to other applications.
Thank you for your helps!
Mustafa Demirhan
|
|
|
|
|
Hello,
I'm trying to stretch a bitmap that is in memory using StretchBlt();. Here is what I'm doing and it isn't working:
HBITMAP hBmp = dibSect.GetSafeHandle();
CDC MemDC, srcMemDC;
CBitmap Bitmap;
if(!srcMemDC.CreateCompatibleDC(NULL)) return -1;
if(!MemDC.CreateCompatibleDC(NULL)) return -1; if(hBmp != NULL) Bitmap.Attach(hBmp); else return -1;
MemDC.SelectObject(hBmp);
MemDC.SetStretchBltMode(COLORONCOLOR);
if(MemDC.StretchBlt(0, 0, 32, 32, &srcMemDC, 0, 0, bmiHeader.biWidth, bmiHeader.biHeight, SRCCOPY) == 0) return -1;
Pos = m_ImageList->Add(MemDC.GetCurrentBitmap(), RGB(0,0,0) );
MemDC.DeleteDC();
srcMemDC.DeleteDC();
|
|
|
|
|
hBmp should be selected into srcMemDC.
Destination bitmap missing.
|
|
|
|
|
I am a beginner programmer just working on my first real windows program. It does a File I/O function which I have a PumpMessages() function in so that it will process the window's messages while it is doing the file I/O. The dialog also has progress bar in it which I would like to use to display the progress of the file I/O operation. The progress bar doesn't seem to receive any of the PBM messages I send it. I am wondering if I need a separate PumpMessages function for the Progress Bar's hWnd.
I'm not sure if I explained this well enough but anyway...
Please help.
Thanks in advance,
Jon
|
|
|
|
|
|
I'm not useing any classes for the dialog or anything. I just created the dialog in the resource editor and I am useing DialogBox() to show the dialog box and a Window Procedure to handle it's messages. I am trying to use SendMessage() to operate the progress bar. I tested this in another program by just simply haveing the progress bar go up everytime a button was pressed and it worked fine. That led me to believe it was a problem with my PumpMessage() function or that I may need a second one for the progress bar's hWnd.
Thanks,
Jon
|
|
|
|
|
So I assume that "not useing any classes" means you are not using MFC. Correct?
|
|
|
|
|
I figured out why it wouldn't work... it was a stupid mistake, involving a global hWnd that had the same name as several local hWnd's, he he rookie mistake.... While I was trying something it just all the sudden clicked in my mind what was wrong...
But thanks for trying to help..
|
|
|
|
|
I used the CXTabCtrl found on this site because i though it would be easier to implement each of my tabs as dialogs. The problem is that I can no longer use a GetDocument() call in my dialogs to access the date in my CMyAppDocument class. How do I get that pointer from within my dialogs?
Thanks for any help.
|
|
|
|
|
Hello all!
Can someone explain the way the registry entries are handled for common files? I'm using SuperPIMP installer from Nullsoft (opensource!) and I need to install some common files. I think I have to add the functionality into the installer.
I think you add 1 to the proper key if it's already installed and create the key when it hasn't been installed yet. Then when you uninstall it, you decrement the key if the value is greater that 1 and delete the key if your program is the only one using it. Is this correct?
BTY, I highly recommend SuperPIMP! It's the best freeware installer out there. It has the most features, it's compact, and it comes with source included! Who could ask for more? Hats off to Justin Frankel!
|
|
|
|
|
I have created a slider in my toolbar class, How do I intercept the slider's scroll messages?
|
|
|
|
|
Category: AdvancedUI
Hello,
I'm trying to (i think) stretch bitmaps? What I'm talking about is similar to stardock's (www.stardock.com) windowblinds feature. The title bar only uses a certain size bitmap, but when the window is resized, so is that little section to span the title bar, without loosing quality.
I've done stretching with StretchBlt(), but depending on the resolution of the bitmap, and the colors (i think hehe), it distorts. I would like to know how windowblinds does it so smoothly.
I have looked at the winamp_ui, and winamp plugin lessons by James Spibey (good job). But they don't appear to do what I'm talking about, and there is alot of flickering when you resize, or move another window around the desktop.
Is there away to stretch only the middle of the bitmap or something to that extent? Whatever you suggest to be able to resize a skinned title bar. Any help is appreciated, thanks.
Geon
|
|
|
|
|
Hello,
This isn't the answer to your question but how did you use stretchblt to resize the bitmap?
You might want to try this template:
http://www.codeproject.com/bitmap/2_pass_scaling.asp
very smooth resizing.
|
|
|
|
|
I open a file for reading by typing:
ofstream datain("c:\\my_program\\data\\my_file.txt", ios::in);
The problem is, when I give the program to some people, they have the data on the c: drive while others have data on the d: drive or something different. Is there any way of opening this file without specifying the drive?
I tried typing:
"..\\my_program\\data\\my_file.txt"
as well as
"../my_program/data/my_file.txt"
but nothing has worked yet!!
Please, any response any one can give me will be greatly appreciated.
Sincerely,
Erich J. Ruth (an overworked graduate student)
|
|
|
|
|
You may retrieve the current dir, or better the executable path, and then append the name of the file.
If you want only the current drive GetCurrentDirectory() is right, just take the first char.
If you want the current executable path, use GetModuleFileName(NULL,...) and cut off the text after the last backslash. Then you may append your file's relative path.
Paolo.
|
|
|
|
|
It is mentally exhausting me trying to write something that converts a number to a dollar format. Does anyone have anything that would consider all possible cases (i.e. negative numbers, numbers less than 3 digits, ...) and that works?
Please, please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle
|
|
|
|
|
Look up the GetNumberFormat() and GetCurrencyFormat() APIs.
|
|
|
|
|