Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Splitter » DHCtrl in SplitterForm
DHCtrl in SplitterForm [message #40595] Tue, 20 August 2013 10:59 Go to next message
iST1 is currently offline  iST1
Messages: 107
Registered: August 2013
Experienced Member
Sorry my English,
i'm created simple example to put some external opened Window in frame of TopWindow with DHCtrl and have a trouble:

GUI_APP_MAIN
{
'this is for emulate of "some external opened Window"
TopWindow child;
Label b;
child.Add(b.SetLabel("Hello!").LeftPosZ(10, 100).TopPosZ(10, 10));

TopWindow main;
SplitterFrame sf;
#if 0
//in top left of main we get "Hello!"
main.AddFrame(sf.Left(child, 100));
#else
//trying to achieve the same as above result with DHCtrl
DHCtrl wrap;
child.Open();

wrap.NcCreate(child.GetHWND());

//probably do not need to do. I'm missing something, when...
child.Hide();

main.AddFrame(sf.Left(wrap, 100));

//...the result is white left frame without "Hello!"
#endif
main.Run();
}

[Updated on: Tue, 20 August 2013 11:27]

Report message to a moderator

Re: DHCtrl in SplitterForm [message #40606 is a reply to message #40595] Thu, 22 August 2013 09:35 Go to previous messageGo to next message
iST1 is currently offline  iST1
Messages: 107
Registered: August 2013
Experienced Member
I'm trying to call a function DHCtrl::SyncHWND, but in her body
(HWND phwnd = GetTopCtrl()->GetHWND()) phwnd is null.

What is GetTopCtrl for DHCtrl?

[Updated on: Thu, 22 August 2013 09:54]

Report message to a moderator

Re: DHCtrl in SplitterForm [message #40617 is a reply to message #40606] Fri, 23 August 2013 16:42 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3033
Registered: August 2008
Ultimate Member
Hello iST1

Although I prepared it some time ago, there are some samples of DHCtrl in Bazaar/Controls4U/FirefoxBrowser.cpp - IExplorerBrowser.cpp - VLCPlayer.cpp that could help you.

What window do you want to attach?



Best regards
Iñaki

[Updated on: Fri, 23 August 2013 16:43]

Report message to a moderator

Re: DHCtrl in SplitterForm [message #40619 is a reply to message #40617] Fri, 23 August 2013 18:00 Go to previous messageGo to next message
iST1 is currently offline  iST1
Messages: 107
Registered: August 2013
Experienced Member
koldo wrote on Fri, 23 August 2013 16:42

Hello iST1

Although I prepared it some time ago, there are some samples of DHCtrl in Bazaar/Controls4U/FirefoxBrowser.cpp - IExplorerBrowser.cpp - VLCPlayer.cpp that could help you.

What window do you want to attach?



I want to plase Excel application in left frame of window and for this use OfficeSheet like:

OfficeSheet sheet;
SplitterFrame sf;

if (sheet.IsAvailable("Open")) {
sheet.Init("Open");
} else if (sheet.IsAvailable("Microsoft")) {
sheet.Init("Microsoft");
} else {
Exclamation("No Excel like");
}

Vector<HWND> hw;
GetProcessMainWindows(GetProcessIdFromName("EXCEL"), hw);

AddFrame(sf.Right(fileForm, 500));
AddFrame(InsetFrame());

for (int i = 0; i < hw.GetCount(); i++) {
HWND excel = hw[i];

::SetParent(excel, GetHWND());
}

void GetProcessMainWindows (DWORD dwProcessID, Vector <HWND> &vWindows)
{
HWND hwnd = NULL;
do {
hwnd = FindWindowEx (NULL, hwnd, NULL, NULL);
DWORD dwPID = 0;
GetWindowThreadProcessId (hwnd, &dwPID);
if (dwPID == dwProcessID)
vWindows.Add (hwnd);
} while (hwnd != NULL);
}

This code works without DHCtrl, but when changing splitter, Excel window remains fixed. May be need to catch some Resize-event in SplitterFrame and call SetWindowPos like in DHCtrl::SyncHWND.

[Updated on: Fri, 23 August 2013 18:02]

Report message to a moderator

Re: DHCtrl in SplitterForm [message #40621 is a reply to message #40619] Fri, 23 August 2013 18:10 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3033
Registered: August 2008
Ultimate Member
Hello iST1

Sorry for my bad memory. I tried in the past to do it. However I could not find the Excel REFIID to be called in QueryInterface.


Best regards
Iñaki

[Updated on: Fri, 23 August 2013 18:10]

Report message to a moderator

Re: DHCtrl in SplitterForm [message #40622 is a reply to message #40621] Fri, 23 August 2013 18:16 Go to previous messageGo to next message
iST1 is currently offline  iST1
Messages: 107
Registered: August 2013
Experienced Member
koldo wrote on Fri, 23 August 2013 18:10

Hello iST1

Sorry for my bad memory. I tried in the past to do it. However I could not find the Excel REFIID to be called in QueryInterface.


In any case, you helped me - i found EditFile in Controls4U!

[Updated on: Fri, 23 August 2013 18:16]

Report message to a moderator

Re: DHCtrl in SplitterForm [message #40625 is a reply to message #40622] Sat, 24 August 2013 00:14 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3033
Registered: August 2008
Ultimate Member
Very Happy

Best regards
Iñaki
Re: DHCtrl in SplitterForm [message #40689 is a reply to message #40625] Mon, 02 September 2013 17:55 Go to previous message
koldo is currently offline  koldo
Messages: 3033
Registered: August 2008
Ultimate Member
Hello iST1

I have been browsing and it seems not possible to embed an Office 2010 application in an OCX.

See this or this.

However you can open a pdf in the InternetExplorerBrowser control just setting the file name in the url.


Best regards
Iñaki
Previous Topic: SetParent to SplitterFrame
Next Topic: Splitting a single ctrl (or appearing to)
Goto Forum:
  


Current Time: Wed Nov 20 20:56:41 CET 2019

Total time taken to generate the page: 0.01106 seconds