|
<br />
OnInitDialog(){<br />
.......<br />
CRect rc;<br />
CWnd* pWnd=GetDesktopWindow();<br />
pWnd->GetWindowRect(rc);<br />
MoveWindow(0,0,rc.Width(), rc.Height(), TRUE);<br />
....<br />
}<br />
Is that all your needs?
|
|
|
|
|
Thanks for the reply,
I think you've misunderstood a bit. I want to show a maximised window that does NOT cover the taskbar area. You might want to try it yourself, have a dialog that the MAXIMIZED BOX is selected FALSE or is not ticked in the resource view. And place ShowWindow(SW_SHOWMAXIMIZED) in OnInitDialog . In my system, that creates a maximised dialog window in full screen. Try to restore the MAXIMIZED BOX, the window is then maximised, with the taskbar still showing.
I could somehow force it using
CRect deskRect;
SystemParametersInfo(SPI_GETWORKAREA, NULL, &deskRect, 0);
MoveWindow(&deskRect);
</code>
But this is not so great because the dialog is not in maxmised mode (where window borders are hidden) and also it's been fixed so if taskbar's size is later changed, the dialog window will still stay the same.
|
|
|
|
|
Try it with Border Resizing
|
|
|
|
|
Thanks Dreamz,
OnSizing() handler in my app isn't be able detect resizing of other applications, including the taskbar. I tried anyway, it won't resize.
|
|
|
|
|
Dont know whether i missed something.But i was talking about the Dialog Properties->Border->Resizing
|
|
|
|
|
Thanks Dreamz,
that's in fact the solution for me That was not difficult at all.
Thanks again
|
|
|
|
|
Welcome
Glad to know it helped you.
|
|
|
|
|
VC++.net,excel 2000,
at first I import the lib as below#import "p:\ofc2000\program files\microsoft office\office\mso9.dll" no_namespace rename("DocumentProperties", "DocumentPropertiesXL")
#import "p:\ofc2000\program files\Common Files\Microsoft Shared\VBA\VBA6\vbe6ext.olb" no_namespace
#import "p:\ofc2000\program files\microsoft office\office\excel9.olb" rename("DialogBox", "DialogBoxXL") rename("RGB", "RBGXL") rename("DocumentProperties", "DocumentPropertiesXL") no_dual_interfaces
//#import "P:\ofc97\MSAPPS\VBA\vbeext1.olb" no_namespace
#pragma warning (disable:4192)
And the I open an exsiting spread sheet:
CLSID clsid;
HRESULT hr = CLSIDFromProgID(L"Excel.Application", &clsid);
if(FAILED(hr))
{
::MessageBox(NULL, "CLSIDFromProgID() failed", "Error", 0x10010);
return;
}
IDispatch *pXlApp;
hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&pXlApp);
pXL.GetActiveObject(L"Excel.Application");
pXL.CreateInstance(L"Excel.Application");
pXL->Visible = VARIANT_TRUE;
pBook=pXL->Workbooks->Open(_T("H:\\xxs\\c++\\geopro\\Print2excel\\P2E\\Geofoam_Slope_Program.xls"));
DWORD aa=::GetLastError();
//Get the Second sheet.
pSheets = pBook->GetSheets();
pSheet = pSheets->GetItem(COleVariant(short(2)));
no error in compile and link,,
error occurs in running, I can open the spread sheet,problem comes from getting the second page of the sheets:GetItem(COleVariant(short(2)));
but this code can run in VC6.0 very well,and error comes from VC++.net,
Why??
Thank you, any suggestion is admired?
asfazxdfvzxvcxzcv
|
|
|
|
|
When you say "error comes from VC++.net", do you mean you're just getting an error when executing that last line 'pSheet = pSheets....'?
I'm assuming that you've cut and pasted some of the code, since it's not exactly clear why you're doing GetActiveObject and CreateInstance
By error, can you be more specific? Since you're using wrapper classes, rather than raw interfaces, any failure will be throwing a _com_error& exception. Can you catch this and interrogate it to try and get more error information? That would probably help the diagnosis.
Steve S
Developer for hire
|
|
|
|
|
Hey,
I am trying to get my menu that I created to show up on a dialog box. I can do it on the document based ones, but that was a long time ago, and can't remember how to do it.
Does anyone have any tutorials on how to create a basic menu? I have found some tuts with many advanced features and don't need all that stuff.
Thanks
|
|
|
|
|
Create the menu in Resource Editor. Add it to the dialog window via SetMenu().
Kuphryn
|
|
|
|
|
Could you perhaps eleborate on the SetMenu() function a bit?
|
|
|
|
|
SetMenu() takes a pointer to a CMenu object. That is it. Declare a CMenu object as the dialog window's member.
Kuphryn
|
|
|
|
|
ok, so i create a menu, go to the class wizard and it asks me to make a new class, so lets say i name it DEPMenu, I then go to the init function of the dialog and type
SetMenu(?);
the ? means what exactly goes inside of it?
|
|
|
|
|
Am i missing something?
If you have the ID of the menu like IDR_MENU1 set it at the Dialog Properties->Menu
|
|
|
|
|
Hallo,
I want to select an item from a list as the list is showed.
I tried to use: m_list.SetItemState (1,LVIS_SELECTED, LVIS_OVERLAYMASK ); but I failed. how can I do it?
thanks in advance!
Dada
|
|
|
|
|
dadacncn wrote:
m_list.SetItemState (1,LVIS_SELECTED, LVIS_OVERLAYMASK );
To select:
<br />
m_list.SetItemState (1,LVIS_SELECTED, LVIS_SELECTED); <br />
To unselect:
<br />
m_list.SetItemState (1,0, LVIS_SELECTED); <br />
|
|
|
|
|
Hi!
I´m trying to capture key messages from within a prop page.
What I did is to put an onkeydown message handler in the page where I wish to capture the key from. But it doesn´t work.
I used this method in a the view of a Document View App and it worked fine.
How does the property sheet deal with this kind of messages.
Do I have to disable all the controls within the page?
thanks in advance.
Daniel Cespedes
"There are 10 types of people, those who understand binary and those who do not"
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|
|
Prop pages contain controls (which are normaly derived from a window). Therefore, the individual controls are getting the OnKeyDown messages not the parent window (a.k.a. Prop page). If you wish to will either need to install a hook when the prop window is created (uninstall when window closes), or subclass all those controls. Recommend you look at the articles on hooking at CP and else where.
INTP
|
|
|
|
|
Thanks John, now I have a better idea about what I have to do.
Daniel Cespedes
"There are 10 types of people, those who understand binary and those who do not"
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|
|
Hello,
i use BITMAP Structure to read image data. as you know bmBits is LPVOID !
I do not know how can access to Array of image data ?
for example i try to declare array such this,
unsigned char *m_pData = new(unsigned char[BM.bmHeight*BM.bmWidth]);
and then Use m_pData = bmBits;(cuase error because bmBits is LPVOID).
thanks for your attention.
I hope hear from you.
|
|
|
|
|
Seems like you should have something like:
CFile fileBitmap(...);
BITMAPFILEHEADER rBitmapFileHeader;
BITMAPINFOHEADER rBitmapInfoHeader;
fileBitmap.Read(&rBitmapFileHeader, sizeof(BITMAPFILEHEADER));
fileBitmap.Read(&rBitmapInfoHeader, sizeof(BITMAPINFOHEADER));
fileBitmap.Seek(rBitmapFileHeader.bfOffBits, CFile::begin);
unsigned char *m_pdata = new unsigned char[rBitmapInfoHeader.biWidth * rBitmapInfoHeader.biHeight];
fileBitmap.Read(m_pData, rBitmapInfoHeader.biWidth * rBitmapInfoHeader.biHeight);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You Mean there is now way to convert Long Pointer and declare array that point to that location in memory?
And i must read bitmap file .
there is somethings that when Bitmap compressed how can i read right Image data.
thanks for your attention.
best wishes.
|
|
|
|
|
mostafa_pasha wrote:
You Mean there is now way to convert Long Pointer and declare array that point to that location in memory?
And i must read bitmap file .
Yes, you must first read the data from disk into memory. At that point, you can "point" to them.
Without knowing more of what you are trying to do, I can't offer anything more helpful.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
i use OpenGL to draw 24-Bitmap Image to screen. in OpenGL image data is BGR not RGB!
so after read image data i must swap Red with Blue.
so i must access image data . i see that if my bitmap compressed and i try to read file
with iostream class and read image data , i can not convert it to raw data.
so i try use BITMAP.bmBits and copy image data to new array and then swap that.
Thanks a lot for your attention.
|
|
|
|