|
carabutnicolae1234 wrote: are there any other ?
Probably. Office is notorious for using functions and controls that are not available to the rest of us.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
What makes you think any APIs are called?
Office uses its own file save dialog so there's probably many dialog-related
APIs used.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I see, thanks.
and is it building the same looking dialog as the standard one ? or it calls it under different name ?
where I can read about this ?
|
|
|
|
|
The dialog Office is using has a similar UI to the common dialog.
Office is a 3rd party app (suite). There's no reason MS would publish how
it's doing its dialogs. I have never seen any documentation on
it.
If the info is public, I imagine it would be available in the
Office development[^] documentation somewhere.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
I need to draw on bitmaps buried deep in a DLL and have no access to HDC or HWND
any attempt to GetDC(NULL) returns a valid pointer but all attempts to draw the bitmap fails.
I'm not using MFC, straight SDK.
Has anyone done this before or know how to implement this?
any help would be appreciated.
|
|
|
|
|
What is a bitmap "buried deep in a DLL"?
You only need an HWND if you're doing something window related.
GetDC() is for obtaining a device context for a window (or the screen).
If you're not drawing there, then that's useless as well.
What are you trying to do?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm trying to do on screen display inside a DirectShow filter.
To show buffering messages.
I figured it would be easy to just create a bitmap the size of the output image, then just draw buffering messages and send it off to the render.
|
|
|
|
|
Assuming you want to use GDI to draw on the video frames...
If you have access to the uncompressed frames before they are rendered,
I would use a DIBSection (see CreateDIBSection).
Create a memory DC (CreateCompatibleDC()), select the DIBSection into it.
For each frame, copy the frame pixel bits into the DIBSection's pixel bits.
Then use GDI to draw to the memory DC.
Copy the pixel bits from the DIBSection back to the frame buffer.
Depending on the renderer you are using, there may be features already there
for overlays.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'll try that...
only difrence is i'll have to create the buffer first, take the previous frame and color convert it to rgb24
then pass it into the CreateDIBSection
draw the message I want,
then color convert it to YUY2 or what ever output format is beeing used.
HBITMAP CreateDIBSection(
HDC hdc, // handle to DC
CONST BITMAPINFO *pbmi, // bitmap data
UINT iUsage, // data type indicator
VOID **ppvBits, // bit values
HANDLE hSection, // handle to file mapping object
DWORD dwOffset // offset to bitmap bit values
);
it needs a HDC,
I dont' have one...
How do i get one, or do i need a valid value? (pass in NULL?)
edit: just looked into CreateCompatibleDC.
If this handle is NULL, the function creates a memory DC compatible with the application's current screen.
would that be dependent if someone is running their display in 16,24, or 32bit?
-- modified at 12:35 Thursday 4th October, 2007
|
|
|
|
|
hvanzyll wrote: t needs a HDC,
I dont' have one...
You can pass NULL for the DC when calling CreateDIBSection.
The DC is only used for DIBs requiring a color table, not RGB DIBs.
hvanzyll wrote: If this handle is NULL, the function creates a memory DC compatible with the application's current screen.
would that be dependent if someone is running their display in 16,24, or 32bit?
The DIBSection will determine the bitmap format so a screen compatible
DC will be fine. Note this is NOT the case with regular DDBs (HBITMAP),
which cannot be selected into an incompatible DC.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you for your help on this.
hopefully my schedule will clear up in the next few days and I will get a chance to implement this.
|
|
|
|
|
Hi guys
I am receiving WM_ERASEBKGND in my app's main window event handler. However, i can't find what is in fact sending this event. I know that this may be sent by BeginPaint, when InvalidateRect's last argument is set to true. But, all of InvalidateRect calls in my app are called with false as the last argument, so i know that this is not the case.
Do you know any other functions/cases that are causing WM_ERASEBKGND to be sent to the app?
BR
dwk
|
|
|
|
|
Are you doing anything that makes the system mark the window
for repainting, like resizing the window, dragging another window
across it, etc??
If the window is just sitting there, you shouldn't be getting random
WM_ERASEBKGND messages.
Note that any WM_ERASEBKGND handler should return non-zero if
background erasing was handled.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm following along with tutorials from www.directxtutorial.com[^] and have succesfully gotten a d3d window up and running. The next section of the tutorial covers running the app in fullscreen, without a title bar or an exit button, requiring changes to be made. One of these changes is the inclusion of a KEY_DOWN and KEY_UP macro, allowing me to check the state of any key. This is implemented so that there is a means of closing the app, using the escape key, however upon pressing the escape key, nothing happens. If I change the line if(KEY_DOWN(VK_ESCAPE)) to if(KEY_UP(VK_ESCAPE)) then the app will exit instantly. Can anybody explain what is happening or what might be causing it?
#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)<br />
#define KEY_UP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)<br />
<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
SNIP!<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
<br />
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_CLOSE:<br />
DestroyWindow(hWnd);<br />
break;<br />
case WM_DESTROY:<br />
Cleanup();<br />
PostQuitMessage(0);<br />
return 0;<br />
case WM_PAINT:<br />
Render();<br />
ValidateRect(hWnd, NULL);<br />
<br />
if(KEY_DOWN(VK_ESCAPE))<br />
PostMessage(hWnd, WM_DESTROY, 0, 0);<br />
return 0;<br />
}<br />
return DefWindowProc(hWnd, msg, wParam, lParam);<br />
}
-- modified at 10:02 Thursday 4th October, 2007
|
|
|
|
|
Sauce! wrote: Can anybody explain what is happening or what might be causing it?
Yes, you can by debugging it and checking the value returned from GetAsyncKeyState()
|
|
|
|
|
unfortunately, I cannot compile in debug as I get errors. I will post these tomorrow. I have been searching about for an article I had a while back that details some of the errors that can occur between a debug or release build and how to fix them, but I've had no luck with that.
|
|
|
|
|
Sauce! wrote: I have been searching about for an article I had a while back that details some of the errors that can occur between a debug or release build and how to fix them, but I've had no luck with that.
Perhaps it was this one.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
YES! Thankyou!
<3 <3 <3 <3 <3
|
|
|
|
|
If we declare a function pointer as
typedef void (*myPtr)(void);
myptr NewPtr;
This means that NewPtr is a function pointer of type myptr, where myptr is inturn a function pointer to a function which returns void and takes no function parameters.. then what does the below piece of code mean?
Can somebody please interpret this piece of code for me?
typedef NTSTATUS (NTAPI *pfnNtQueryInformationProcess)(
IN HANDLE ProcessHandle,
IN PROCESSINFOCLASS ProcessInformationClass,
OUT PVOID ProcessInformation,
IN ULONG ProcessInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
pfnNtQueryInformationProcess gNtQueryInformationProcess;
Thanx
-- modified at 9:07 Thursday 4th October, 2007
|
|
|
|
|
exactly the same as your code, at the difference that the pfnNtQueryInformationProcess is a typedef to a function pointer to a function which returns a NTSTATUS and gets as parameters a HANDLE, a PROCESSINFOCLASS, a PVOID, an ULONG, and a PULONG...
then you declare a variable gNtQueryInformationProcess of that type so defined...
what don't you understand in this ?
|
|
|
|
|
Then it should have been declared as
typedef NTSTATUS (*pfnNtQueryInformationProcess)(
IN HANDLE ProcessHandle,
IN PROCESSINFOCLASS ProcessInformationClass,
OUT PVOID ProcessInformation,
IN ULONG ProcessInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
pfnNtQueryInformationProcess gNtQueryInformationProcess;
What is this NTAPI in between? What is its signifance?
Thanx
|
|
|
|
|
kiranin wrote: What is this NTAPI in between
it is the calling convention... see how it's defined if that interrest you, but it's probably one of these : __stdcall, __fastcall, __cdecl, __thiscall...
|
|
|
|
|
hm.. yeah dats rite.. its a calling convention.. herez the piece of code frm winnt.h
#if ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)) && !defined(_M_AMD64)
#define NTAPI __stdcall
#else
#define _cdecl
#define NTAPI
#endif
Thanx
|
|
|
|
|
pfnNtQueryInformationProcess is a function pointer to a function that returns NTSTATUS , has an NTAPI calling convention, and takes five arguments.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|