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 » Developing U++ » UppHub » SysInfo - some bug fixes (Window_SaveCapture/Window_Top)
SysInfo - some bug fixes [message #47094] Fri, 02 December 2016 14:02 Go to previous message
luoganda is currently offline  luoganda
Messages: 193
Registered: November 2016
Experienced Member
Both is for windows version - v10502:

1)For all 3 this kind'a functions:
void Window_Top(int64 windowId){
  SetWindowPos(reinterpret_cast<HWND>(windowId), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE || SWP_NOSIZE || SWP_SHOWWINDOW);
}
from || into | -> thats SWP_NOMOVE | SWP_NOSIZE ... 

Note: Window_Top will not set foreground window properly(at least not on windows xp) - to reproduce this
fully maximize some window(eg TheIDE) and use Window_Top/Window_TopMost on some background window - it won't work.
For one who want's properly set-foreground-window, try this link(scroll down to SwitchToWindow)
https:// groups.google.com/forum/#!topic/comp.os.ms-windows.programme r.win32/loryh6U6KFg
Note for code in link: SwitchToThisWindow seems that it doesnt need to be loaded by LoadLibrary - can be used directly.
On windows xp sp3/4 it works as expected.


2)Window_SaveCapture - gdi mem leak and incorrect results for lets say 16 bit screen depth:
end:
	SelectObject(hDC, oldBM); into -> SelectObject(memDC, oldBM);

returned Image does not return proper 'bitmap', because requesting dib is not set:
-setting requested dib to 24bit(because generally 32bit seems to not work correctly?)
-convert to Image format, that's from requested 24bit-pixels to Image 32bit-pixels
Should do the trick.
The optimized way would be to copy pixels directly from ScreenDC(GetDC(0)) to 32Bit Image format.

[Updated on: Fri, 02 December 2016 14:06]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Functions4U: Added LocalProcessX
Next Topic: U++ Command Line Argument Processor Package
Goto Forum:
  


Current Time: Tue Apr 16 09:14:35 CEST 2024

Total time taken to generate the page: 0.02009 seconds