Home » U++ Library support » Splitter » DHCtrl in SplitterForm 
	
		
		
			| DHCtrl in SplitterForm [message #40595] | 
			Tue, 20 August 2013 10:59   | 
		 
		
			
				
				
				
					
						  
						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 #40617 is a reply to message #40606] | 
			Fri, 23 August 2013 16:42    | 
		 
		
			
				
				
				  | 
					
						  
						koldo
						 Messages: 3453 Registered: August 2008 
						
					 | 
					Senior Veteran  | 
					 | 
		 
		 
	 | 
 
	
		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    | 
		 
		
			
				
				
				
					
						  
						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 #40622 is a reply to message #40621] | 
			Fri, 23 August 2013 18:16    | 
		 
		
			
				
				
				
					
						  
						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 #40689 is a reply to message #40625] | 
			Mon, 02 September 2013 17:55   | 
		 
		
			
				
				
				  | 
					
						  
						koldo
						 Messages: 3453 Registered: August 2008 
						
					 | 
					Senior Veteran  | 
					 | 
		 
		 
	 | 
 
	
		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
		
 |  
	| 
		
	 | 
 
 
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 03:34:58 CET 2025 
 Total time taken to generate the page: 0.03923 seconds 
 |