Pandetthe
Positioning window in per monitor aware v2
Hi! I am trying to position the wpf window perfectly within the selected screen. When I am using the unaware option everything works fine, but in per monitor aware v2 it's a little bit complicated. I have information about screen scalling and bounds. Firstly I thought that I can just multiplicate scalling and bounds to get the correct position. I was wrong. When the selected screen is under the primary screen, then the top/y position should not be scaled, but when is above it should. What would happen if there were three monitors in the row, primary first, then some monitor with weird scaling and then selected screen? Is there some option to easily get these bounds? I want to make this clean, because now I have a temporary solution. When creating a new window I am changing dpi aware to unaware.
80 replies
WPF inkcanvas input simulation
Hi!, I am trying to add my own input for Wpf inkcanvas. I have now working code for adding new points and creating from them strokes. This solution works perfectly for drawing, but not for erasing. Is there any option for simulating your own input for inkcanvas or something similar?
2 replies
Wpf combobox
Hi! I am doing some app with Wintab api in WPF. I am trying to "extend" combobox control that it will be possible for me to programaticly interact with control on specific window coordinates, for example click. I know how to open and close combobox (using togglebutton), how to interact with popup window, how to interact with scrollviewer, but I couldnt find how to interact and select specific item. Is this interaction logic in combobox or comboboxitem or somewhere else. I know I can change selection index in combobox item, but I wouldn't get all default visuals.
1 replies
Wpf custom button template proble
Hi! I am trying to create custom button control, but I have a problem with a content property. Button is displaying properly if the content is set in it's code, but when I am trying to do this in some view, only it's content is visible without border etc.
3 replies
✅ Wndproc is not receiving any messages when window is not focused
HI! I am trying to handle messages in WPF using WndProc like this:
When window is focused everything is working fine, but when I select another window, wndproc stop receiving any messages. How can I fix it?
22 replies
Wpf combobox problem
Hi! I came across an interesting problem today and I don't know how to overcome it. I have ObservableCollection<CustomWindow> where CustomWindow is including Window class and has public string property Example. I am using it as an ItemSource for combobox with DisplayNamePath="Example". Dropdown list is being displayed correctly but after selecting any option from it, selection box is still empty and I get System.Windows.Data Error: 40 : BindingExpression path error: 'Example' property not found on 'object' ''Frame' (Name='ViewControl')'. BindingExpression:Path=Example; DataItem='Frame' (Name='ViewControl'); target element is 'TextBlock' (Example=''); target property is 'Text' (type 'String')
2 replies
WPF, "emulate" mouse click
Hi. I am working with WPF and I am adding Wintab API(tablet API). I want to "emulate" mouse click event on specific coordinates to avoid creating own buttons and other controls that will have this compatibility. Is there any option to call some kind of event or easily create own?
12 replies
Struct with explicit layout
Hi, I am using Wintab and I am trying to make packet struct, but I have some problem. In some situations field x is uint but in others it's a int. Is there any option to determine if it's now uint or int or I need to have two fields - uint and int at the same offset
13 replies
❔ Best duplex communication protocol
Hi! What do you guys think that will be the best way to have communication between 2 apps (one in .net c# and one in other language, so technology cannot be only for .net). It's needed to be possible in two directions and easy to send files and some other text data.
26 replies
❔ How to disable automatic time sync?
Hi! I am trying to add to my app manual time setting using SetSystemTime from kernel32.dll, but I couldnt find how to disable/enable automatic time sync with ntp server. I found that it can be done by setting [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters]
"Type"="NoSync", but it changes back occasionally
3 replies
❔ Restricting mouse movement
Hi!,
I am trying to restrict mouse movement on the area of the whole screen. I am using SetWindowsHookEx for LowLevelMouseProc. For checking monitor area I am using GetMonitorInfo, and here is my problem. When all screens have the same dpi, everything is fine, if primary screen have scaling 125%, and screen where I want to restrict movement 100%, everything is fine but if primary has 100% and second has 125%, boundaries of the screen are wrong.
7 replies