Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

Jan R Hansen

@Jan R Hansen
About
Posts
407
Topics
74
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Jim Lovell has passed away.
    J Jan R Hansen

    How can you (of all, or "of a very few) not have enough rep to post links? Somebody please award him more rep!

    Unless, of course, it's an impostor! How will we know?

    Good to see CP back in action. Thank you for all the hard work.

    The Lounge

  • Which monitor would you choose?
    J Jan R Hansen

    Personally, I've had two transitions. Sorry about the lengthy post... First from a dell 27" 2560x1440 to a samsung 49" 5120x1440. It was either that, or two 27" monitors. While the 49" 5120x1440 is a _very_ wide monitor, it is superb for e.g. Visual stuido. 3-4 files open side-by-side, as well as toolboxes. Awesome! Highly recommended! But also more expensive than the two corresponding 27" monitors. Physical screen size is 100% equivalent between those two solutions, it's only a question of having the insanely annoying bracket between the monitors, or not. I prefer the single monitor solution by far, since I otherwise tend to have "two fullscreen monitors", rather than "one huge surface where I can place windows - also in the middle, since there are no annoying brackets". With to monitors I find myself looking directly at one right in front of me, and getting a neck-pain from looking at the other one, located to the left or right. Alternatively, having both located to the side of your "staring straight ahead" line, you have to look either to the left or the right. You're probably used to that now, but after *not* having those brackets down the middle, you don't want to go back. Regarding physical monitor size and old-eyes problems (I'm getting there, getting closer to 50 now :) ). You're used to 1440p vertically on a 24" monitor. Switching to a 1440p on 27" is a huge improvement, since you will get the same number of pixels, but each pixel will be larger, so no change in number of code lines visible, but everything will be larger. Equivalent to moving your eyes closer to your current monitors. If you switch to 27" 4K you will more or less retain pixel size, but will have more pixels (hence get room for more code lines). Like adding more pixels to your current monitors. In that case, you will have to start scaling in order to get larger text, so thats that... More or less the same, I don't think you will find that the scaled version is significantly better or worse than the non-scaled one. So, either one will probably be fine. Now, what I didn't think of beforehand - but has come to appreciate a lot later - was the switch from 60 Hz to 120 Hz. The strain on your eyes is really a lot less. 120 Hz is just a lot more "calm" to look at. Not like the difference from - say 30Hz to 60Hz on the old CRT tubes. But it's there. Very much. Now, the second transition. Due to office re-arrangements, I decided to move the 49" 5120x1440 from the home-office to the office-office, and got a 34" (OLED) 3440x1440 for the home

    The Lounge com question

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    Thanks! :thumbsup: I followed you example, and apart from having to right-click on the display capture source and select transform->fit to screen, it works just fine. Sort of. Because it appears that the transformation from a 2560x1440 area to a 1920x1080 (base canvas resolution and output scaled resolution under settings>video) makes text hard to read. I haven't yet tried to change to a 1:1 base/output resolution of 2560x1440, but that might fix it. Are you familiar with OBS and would you be able to provide a hint in that area?

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    Quote:

    That's actually a good idea, give them the suggestion, they are some better than others getting feedback from users.

    Someone did that 9 months ago :) https://www.nvidia.com/en-us/geforce/forums/game-ready-drivers/13/389789/feature-request-virtual-split-screen-for-ultrawi/?topicPage=17[^]

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    yeah... you should consider using the .bat-file approach in that case. Since you run PowerToys anyway, you can use PowerToys Run to quickly execute "2560.bat" that fires the powershell command I pasted above and switches to that resolution. When you're done with the meeting, you just run ".bat" and switches back to your preferred resolution. Since your aspect ratio doesnt change (mine does) I think most window positions will be retained (relatively) and windows in full screen remain such, which is fine for you, but not for me... So that might be a quick and dirty solution for you, untill MS decides to fix Teams.

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    Thanks. Yeah, the sizer-thing is nice and all, but still relies on eventually sharing an app, not a screen-area where I can switch between apps within the area. The PIP-mode is more the oppsite thing, where the monitor can display e.g. HDMI and DisplayPort1 at the same time. But points for creative thinking :-D A secondary monitor has been mentioned before, and while it probably is the fast-track solution, it still takes up space on my desk, and it would be nice to handle this without extra hardware. A USB version might be a sort of lightweight alternative though. Any recommendations?

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    Thanks for the suggestion! As I understand it; I would need to have my dev environment running inside a VM, and work through an RDP connection, only to gain the ability to have everything running inside an app that would be shareable from the physical machines OS, right? To me, thats more troublesome than executing my "switch to 2560x1440.bat" before the teams meeting and then the "switch to 5120x1440.bat" after the meeting. Why, oh why, can't we just have an option in Teams to share a part of the screen... Or have NVidia register the physical monitor as a number of physical monitors. That way, Windows wouldn't know the difference, and everything would work.

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    Yes - it "sounds" really cool. The problem is, that it doesn't hold water. You cannot divide my Samsung CRG9 49" 5120x1440 monitor (or similar monitors, from other manufacturers) into anything that *windows* recognizes as multiple monitors. There are a number of software solutions, like (previously mentioned) - GitHub - microsoft/PowerToys: Windows system utilities to maximize productivity[^] - DisplayFusion: Multiple Monitors Made Easy by Binary Fortress Software[^] Easy Setting Box | Monitor Solution | Samsung Display Solutions[^] but all of these are software tools that adds a way of organizing windows into sections of the monitor in a more convenient way. Microsoft Teams allows you to share applications or "desktops". The latter being actual displays that windows recognizes as physical displays. So unless your graphics driver is able to map the actual monitor as separate physical devices, you're out of luck with Teams. For all other purposes, the tools mentioned above work just fine. PowerToys and the samsung tool are even free, and DisplayFlusion comes in a free (feature-restricted) edition as well. Being able to split the physical monitor to allow shortcuts like WIN-ARROWLEFT etc work for window snapping would be great, but not available as of now.

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    Nice find! That was the exact app I mentioned in my original post. The problem seem to be that it doesn't work as desired in teams anyway, however - here is the link for future reference GitHub - john--/FauxDesktop[^]

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    not three windows, just visual studio with three documents inside.Just right-click any document header-tab and select "New vertical document group"

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    Thanks. I already have a .bat-file which executes a powershell-script, that switches to a given resolution. Very fast and efficient. but still less elegant than getting away with sharing a custom part of your screen. this

    Import-Module $PSScriptRoot\setScreenResolution\setScreenResolution -Verbose

    Set-ScreenResolution -Width 2560 -Height 1440

    executes this (which I copied from a MS resource somewhere)

    Function Set-ScreenResolution {

    <# 
        .Synopsis 
            Sets the Screen Resolution of the primary monitor 
        .Description 
            Uses Pinvoke and ChangeDisplaySettings Win32API to make the change 
        .Example 
            Set-ScreenResolution -Width 1024 -Height 768         
        #> 
    param ( 
    \[Parameter(Mandatory=$true, 
               Position = 0)\] 
    \[int\] 
    $Width, 
     
    \[Parameter(Mandatory=$true, 
               Position = 1)\] 
    \[int\] 
    $Height 
    ) 
     
    $pinvokeCode = @" 
     
    using System; 
    using System.Runtime.InteropServices; 
     
    namespace Resolution 
    { 
     
        \[StructLayout(LayoutKind.Sequential)\] 
        public struct DEVMODE1 
        { 
            \[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)\] 
            public string dmDeviceName; 
            public short dmSpecVersion; 
            public short dmDriverVersion; 
            public short dmSize; 
            public short dmDriverExtra; 
            public int dmFields; 
     
            public short dmOrientation; 
            public short dmPaperSize; 
            public short dmPaperLength; 
            public short dmPaperWidth; 
     
            public short dmScale; 
            public short dmCopies; 
            public short dmDefaultSource; 
            public short dmPrintQuality; 
            public short dmColor; 
            public short dmDuplex; 
            public short dmYResolution; 
            public short dmTTOption; 
            public short dmCollate; 
            \[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)\] 
            public string dmFormName; 
            public short dmLogPixels; 
            public short dmBitsPerPel; 
            public int dmPelsWidth; 
            public int dmPelsHeight; 
     
            public int dmDisplayFlags; 
            public int dmDisplayFrequency; 
     
            public int dmICMMethod; 
            public int dmICMIntent; 
            public int dmMediaType; 
            pub
    
    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    Hacksaw? I dont have room for another monitor next to this monstrous thing...

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge csharp sharepoint winforms com business

  • Teams screen sharing on a ultrawide monitor
    J Jan R Hansen

    So, I have treated myself with a 5120 x 1440 ultrawide monitor, which for coding purposes works perfect. Loads of pixels available for VS2019 to use; toolboxes and 3 concurrent code files open next to each other. Life is great. However... when screen sharing with a client during a Teams meeting, I can share either my "desktop" or a specific application. None of these works very well. Oftentimes, I need to swap between different windows during the meeting, and as such, I cannot use the "share an app" approach. Sharing the desktop is even worse, as my clients usually have standard 1920x1200 or that kind of aspect ratio, and would be presented with a very wide and very low image of my entire desktop. So, I've reverted to quickly switching my windows resolution to 2560x1440 before starting screen share, and then back again after the meeting. It works, but is annoying. A lot of people are requesting the "share a custom screen area" feature in Teams: https://microsoftteams.uservoice.com/forums/555103-public/suggestions/38834104-share-custom-area-of-screen Have any of you come accross something that can mitigate this until MS decides to implement this feature? I once found a winforms application that allegedly should be only the "frame" or "windows" around an application, hence allowing the meeting audience to see through that frame. that way, one could share that particular application and effectively obtain a custom area of screen sharing. However, I cannot find that again (my google-foo must be low currently) and I cannot remember if it was possible to click on the applications "behind" the one acting as presentation area. Other alternatives include - use two inputs on the monitor simultaneously, hence having two 2560x1440 monitors in the windows display options, and you can share only one of them. Not suitable for me, due to "gaming requirements" on the same setup. - use screen splitting like PowerToys FanzyZones or DisplayFusion, but those virtual "splits" are not recognized by Teams as indivisual desktops. So, no-go as well. Any ideas? Or maybe someone knows the application or one like it? /Jan

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one.

    The Lounge csharp sharepoint winforms com business

  • Did you know...
    J Jan R Hansen

    I'd recommend UltraEdit. You can disable the "make automatic backups when opening files" and then you are able to open and work with very large files. Fast. That feature, and built-in hex edit that allow me to see everything, including BOM bytes in files makes it worth the license fee. Just if you didn't know it - and needed something better than notepad and notepad++ for large files :)

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge visual-studio xml question

  • Comic sans walks into a bar...
    J Jan R Hansen

    for some reason, Trend Micro worry-free business security (what a name...) won't let me see that webpage. Website blocked by Trend Micro Worry-Free Business Security Malicious website blocked ... great. It HAS to be funny if I can't see it :cool:

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge sysadmin

  • Favourite feature of Windows 7 so far...
    J Jan R Hansen

    When I'm at two screens it used to bother me that I could only dock at the leftmost half of the left screen, and rightmost half of the right screen. WIN+ARROWLEFT and WIN+ARROWRIGHT will allow you to use "all four positions". Thank you, Microsoft. WIN+ARROWUP will maximize , while WIN+ARROWDOWN will restore if maximized and minimize to taskbar if windowed. Nice as well. Also, consider WIN+P where you can now easily switch between you monitor and the attached projector. No more fiddling around with Intel/IBM/HP specific software. /Jan

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge c++ architecture

  • RequiredFieldValidator doesn't work
    J Jan R Hansen

    Something must be wrong, as this is probably the most basic validation example ever - yet I still can't get it to work properly, and I actually suspect an error somewhere. Create an aspx page with a textbox, a requiredfieldvalidator and a button. Set the validator to validate the textbox and set its text property to "*". Run the project. Now, I would assume that clicking the textbox and then tabbing to the button would show me the text-message from the validator (the red *), indicating that I haven't entered data where I need. Guess what - it doesn't show up... However, clicking the field, entering data, tabbing away and then back, deleting the data again and then tabbing away again DOES show the red *. Because the validation of the textbox is handled from the onchange event. Try running this in the url field: javascript:void(alert(document.all.TextBox1.onchange)) - it will give you Message from webpage --------------------------- function anonymous() { ValidatorOnChange(event); } , whereas the javascript:void(alert(document.all.TextBox1.onchange)) will return null. Manually hooking the onblur event to the onchange event as so: javascript:void(document.all.TextBox1.onblur=document.all.TextBox1.onchange) will introduce somehow correct behaviour. Now - is it me who has failed to understand the simples of all validation scenarios - or is the requiredfieldvalidator broken. I hope it is the first option, but what the h... am I missing? Sample code:

    <form id="form1" runat="server">
    <div>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
    ErrorMessage="RequiredFieldValidator"
    ControlToValidate="TextBox1"
    Text="*"></asp:RequiredFieldValidator>
    <asp:Button ID="Button1" runat="server" Text="Button"/>
    </div>
    </form>

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    ASP.NET javascript sysadmin help tutorial question

  • Events from ServiceHost instance ?
    J Jan R Hansen

    Brian, That hit the spot - thank you. So simple, and yet so far away from my mindset. I owe you a :beer:, remind me if we ever meet :-D /Jan

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    WCF and WF csharp wcf hosting help tutorial

  • Events from ServiceHost instance ?
    J Jan R Hansen

    Hi all, I've been struggling with this for quite a time now - maybe one of you can help me. Imagine this scenario: I have an instance of a "Engine" class, which in turn has a ServiceHost instance, hosting a WCF service of type ProcessingEngine. I want the "Engine" to be notified from the service when it has received a message (or whatever) - but I cant figure out how to emit custom events from the service. Here is some code to illustrate:

    /* Host */
    public class Engine
    {

    public void Start()
    {
    	// Create service host
    	m\_processingServiceHost = new ServiceHost(typeof(ProcessingServices.ProcessingService));
    	
    	// Sign up for events
    	// ???
    	
    	// Start the service
    	try
    	{
    		m\_processingServiceHost.Open();
    	}
    	catch (Exception ex)
    	{
    		FireErrorDetected(ex.Message);
    	}
    }
    

    }

    /* Service */
    public class ProcessingService : IProcessingService
    {
    public void SendData(int value)
    {
    // Send an event
    // ???
    }
    }

    Any ideas ? Best regards, Jan Hansen

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    WCF and WF csharp wcf hosting help tutorial

  • The color swap accident...
    J Jan R Hansen

    Yeah, I'll try that. It might not get me anywhere, but I might get lucky and get to know what "they" have done to the images. /Jan

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    The Lounge graphics question php winforms com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups