Quantcast
Channel: General Windows Desktop Development Issues forum
Viewing all 6180 articles
Browse latest View live

TS Virtual channel connect/disconnect mismatch - not being notified of CHANNEL_EVENT_CONNECTED, does receive CHANNEL_EVENT_DISCONNECTED

$
0
0

Under what circumstances would CHANNEL_EVENT_CONNECTED and CHANNEL_EVENT_DISCONNECTED not be matched pairs?

A customer has environment of Windows 7/XP running Remote Desktop connecting to Windows Server 2012 R2 / 2012 / 2008R2.

We provide a virtual channel, customer has installed on the client but on (some of) the server side is not installed.

Only when disconnecting from Windows Server 2012 R2 where virtual channel is not present do they get an error from our software.

We and Customer get CHANNEL_EVENT_INITIALIZED and CHANNEL_EVENT_TERMINATED as expected.

In Windows 7 environment the virtual channel client is getting CHANNEL_EVENT_DISCONNECTED when the remote connection is closed, but we have some error due to not being notified CHANNEL_EVENT_CONNECTED when the connection was started.

In our Windows 8 environment it performs as expected -

  • without server side installed we get neither event
  • with server side installed we get both events.

In comparison, when winlogon is presented there (seemed to be) additional messages when connecting from Windows 7, they flick past quickly but mentioned session manager.  I had not noticed similar messages when connecting from Windows 8.

We can work around this to avoid disruption to the customer, but would like to know more about this scenario so we can better handle the use case.

Or perhaps there is a Hotfix for RemoteDesktop?

One thought was session redirection as according to the doc on VirtualChannelInitEvent (http://msdn.microsoft.com/en-us/library/aa383568(v=vs.85).aspx)

CHANNEL_EVENT_CONNECTED and CHANNEL_EVENT_DISCONNECTED event notifications will not be sent if the connection is transferred to another session. However, the server-side plug-in that is administering the session to which the connection is transferred will receive a reconnection notification. A server-side tool such as Tscon.exe can be used to transfer connections. Refer to Monitoring Session Connections and Disconnections for more information on reconnection notifications.

If the user-mode plug-in must be notified that it has been reconnected (for example, if it must reset its state), the server-side plug-in should send a notification message to the client. This notification should use the protocol that the plug-ins use to communicate with each other.

It seems that even if redirection would be an issue, both events would not be present.


I defined MaxUserPort in HKLM\SYSTEM\CurrentControlSet\Services\Tcpip with decimal value 5002. But not able to understand its work and signification.

$
0
0

I have read following ARTICLE 

https://technet.microsoft.com/en-us/library/cc938196.aspx

And, as per the definition

.

Definition: - 

Determines the highest port number TCP can assign when an application requests an available user port from the system. Typically, ephemeral ports (those used briefly) are allocated to port numbers 1024 through 5000.

.

Issue Description: - There is a Socket initialize on my server machine on port 9090. Suppose an application request for particular service i.e. communicate on server port by client program.  My client program is getting date message properly with some dynamic ports.

.

How and where, I can check "MaxUserPort" definition. How does it work and what is the significance of it. 

.

Kindly assist me to understand. I will be really thankful.



Regards, S.P Singh


VirtualChannelWrite is hanging on RDS 8.1 clients

$
0
0

VirtualChannelWrite is hanging on RDS 8.1 clients

Our custom audio channel implementation (using WTS / RDS  Virtual Channel API) does not work  when connecting from Windows 8.1 to Windows Server 2012 R2. The call to pVirtualChannelWrite() never returns in that environment.

All other combinations (Windows 7, Windows 8, Windows Server 2008, Windows Server 2012) are working.

The pVirtualChannelWrite() function and the VirtualChannelOpenEvent() function are called in two different threads. The call to pVirtualChannelWrite() is hanging as soon as we get a VirtualChannelOpenEvent() when the data we receive is larger than e.g. 400 byte.

We recognized the following difference to previous clients or Protocols:

- With RDP 8.1 the VirtualChannelEntry() and VirtualChannelInitEventProc() function with CHANNEL_EVENT_CONNECTED are called from two different threads at the beginning. With RDP 7.1 only one thread is used for this functions which is used for for following processes too.

- With RDP 8.1 our data package from the Server is split up into 2 packages although it is below the maximum of 1600 defined by CHANNEL_CHUNK_LENGTH. With RDP 7.1 it is received in one part.

Maybe related: We could not test this behaviour on Windows 7 because the RDP 8.1 Update for Windows 7 was removed few days after Release. 

Please can you give any help about this issue?

Does "InitiateShutDown" actually call WM_CLOSE/WM_DESTROY of an app?

$
0
0

I am using RegisterApplicationRestart() method to restart an application. Now, the issue that I am facing is that I am trying to write some event when the application is closed (normally).

What happens is that, I can close the application (by clicking the 'X' on the top right corner) in which case, I want to write an event. But if the application is restarted because of certain things (RegisterApplicationRestart() followed by InitiateShutdown()) I don't want to write the event.

How I plan to solve this is that I am intercepting the WM_CLOSE message and trying to write an event then. But, I am not sure if InitiateShutdown() actually calls WM_CLOSE. If it does not, it becomes easy for me, but if it does, I have to do some kind of check so that it does not write in that case. I tried debugging and it appears that WM_CLOSE is not hit when InitiateShutDown() is called, but I want to re-verify. 

Any pointers? MSDN documentation is not saying anything about this.

Screen shot of PowerPoint slideshow window

$
0
0

Hello,

I am trying to take screenshot of the powerpoint slideshow window. I have got the handle of the slideshow window. I am using the below code to take the screenshot. 

internal static Image ScreenCaptureGdi(IntPtr hwnd)
{
    IntPtr hdcDest = IntPtr.Zero, hdcSrc = IntPtr.Zero, hBitmap = IntPtr.Zero;
    try
    {
        hdcSrc = NativeMethods.GetWindowDC(hwnd);
        NativeMethods.Rect windowRect;
        NativeMethods.GetWindowRect(hwnd, out windowRect);
        var width = windowRect.right - windowRect.left;
        var height = windowRect.bottom - windowRect.top;

        hdcDest = NativeMethods.CreateCompatibleDC(hdcSrc);
        hBitmap = NativeMethods.CreateCompatibleBitmap(hdcSrc, width, height);

        var hOld = NativeMethods.SelectObject(hdcDest, hBitmap);
        NativeMethods.BitBlt(hdcDest, 0, 0, width, height, hdcSrc, 0, 0, NativeMethods.Srccopy);
        NativeMethods.SelectObject(hdcDest, hOld);
        Image img = Image.FromHbitmap(hBitmap);
        return img;
     }
     catch (Exception)
     {
        throw;
     }
     finally
     {
         NativeMethods.DeleteDC(hdcDest);
         NativeMethods.ReleaseDC(hwnd, hdcSrc);
         NativeMethods.DeleteObject(hBitmap);
     }
}

Here are the NativeMethods that I am using :

[DllImport("user32.dll")]
internal static extern IntPtr GetWindowDC(IntPtr hWnd);

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool GetWindowRect(IntPtr hWnd, out Rect lpRect);

internal static Rectangle GetWindowRect(IntPtr hwnd)
{
    Rect rect;
    GetWindowRect(hwnd, out rect);
    return rect.AsRectangle;
}

[DllImport("gdi32.dll")]
internal static extern IntPtr CreateCompatibleBitmap(IntPtr hDc, int nWidth, int nHeight);

[DllImport("gdi32.dll")]
internal static extern IntPtr CreateCompatibleDC(IntPtr hDc);

[DllImport("gdi32.dll")]
internal static extern IntPtr SelectObject(IntPtr hDc, IntPtr hObject);

[DllImport("gdi32.dll")]
internal static extern bool BitBlt(IntPtr hObject, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hObjectSource, int nXSrc, int nYSrc, int dwRop);


[StructLayout(LayoutKind.Sequential)]
internal struct Rect
{
    internal int left;
    internal int top;
    internal int right;
    internal int bottom;

    public Rect(int left, int top, int right, int bottom)
    {
        this.left = left;
        this.top = top;
        this.right = right;
        this.bottom = bottom;
    }

    public Rectangle AsRectangle
    {
        get { return new Rectangle(this.left, this.top, this.right - this.left, this.bottom - this.top); }
    }

    public static Rect FromXywh(int x, int y, int width, int height)
    {
        return new Rect(x, y, x + width, y + height);
    }

    public static Rect FromRectangle(Rectangle rect)
    {
        return new Rect(rect.Left, rect.Top, rect.Right, rect.Bottom);
    }
}

[DllImport("gdi32.dll")]
internal static extern bool DeleteDC(IntPtr hDc);

[DllImport("gdi32.dll")]
internal static extern bool DeleteObject(IntPtr hObject);

[DllImport("user32.dll")]
internal static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDc);
The problem with this methods is that there are few system which displays the screenshot of the slideshow correctly. In other systems when I take the screenshot using this machine, I am getting a black screen of the slideshow. 


Most of the machines that I have tested the images are getting generated properly. Problem with few system please help me. I have been trying to fix for more than a week now but in vain. Please help


mehulviby

License for vb 6.0 development

$
0
0

I continue to support a desktop applications written in vb 6.0.  

The application was written in 1996/97 and modified over the years.  

The executable still runs in compatibility mode on windows 7, so I need to maintain it until windows 7 is no longer available.

I've long since lost the License paperwork and installation media.  

Can I maintain my software without a vb 6.0 License??


Inbound Windows advanced firewall rules not working

$
0
0
Hello,

I'm developing a desktop server app that listens on a port.  I created a custom inbound firewall rule like this -

Rule Name:                            My Custom Rule
----------------------------------------------------------------------
Enabled:                              Yes
Direction:                            In
Profiles:                             Domain,Private,Public
Grouping:                             
LocalIP:                              Any
RemoteIP:                             Any
Protocol:                             TCP
LocalPort:                            443
RemotePort:                           Any
Edge traversal:                       No
Program:                              C:\Program Files (x86)\MyApp\MyServerApp.exe
InterfaceTypes:                       Any
Security:                             NotRequired
Rule source:                          Local Setting
Action:                               Allow
Ok.

Yet the client can't connect to the server and the firewall log shows...                                                                                                                                                                                                               
#Version: 1.5
#Software: Microsoft Windows Firewall
#Time Format: Local
#Fields: date time action protocol src-ip dst-ip src-port dst-port size tcpflags tcpsyn tcpack tcpwin icmptype icmpcode info path

2016-03-15 10:33:42 DROP TCP 192.168.0.196 192.168.0.199 59207 443 60 S 1857348202 0 65535 - - - RECEIVE
2016-03-15 10:33:44 DROP TCP 192.168.0.196 192.168.0.199 59207 443 60 S 1857348202 0 65535 - - - RECEIVE
2016-03-15 10:33:46 DROP TCP 192.168.0.196 192.168.0.199 34293 443 60 S 992642717 0 65535 - - - RECEIVE
2016-03-15 10:33:47 DROP TCP 192.168.0.196 192.168.0.199 34293 443 60 S 992642717 0 65535 - - - RECEIVE
2016-03-15 10:33:49 DROP TCP 192.168.0.196 192.168.0.199 34293 443 60 S 992642717 0 65535 - - - RECEIVE

If I remove the program name so the rule applies to any program, then it works.  I did verify from task manager that the app name/path exactly matches what's running.  Port 443 is an example; other ports don't work either.  Any advice would be greatly appreciated.

Thanks!

Capture Mouse and Keyboard Activity Events Over Slide in SlideShowView (Presentation Mode)

$
0
0
Hi,
   As PowerPoint doesn't expose slideshowView events in presentation Mode for a work around we have used keyboard Mouse hooking dll to capture user activities over slide in slideshow mode but we are facing different types of issues.

Is there another way to capture user activity over slide in presentation mode?

If some one has used better way of mouse hooking in presentation mode with no issues could please help me? 

How does DirSync control for Active Directory work

$
0
0

Hi,

Can someone explain how DirSync control works for Active Directory.

How am I supposed to handle it.

Does it matter if I use the same dirsync cookie for different requests with different search filter and/or different attributes.

Is dirsync dependant on search filter or search attributes or any other factors...

To avoid any confusion, I'm talking about "System.DirectoryServices.Protocols.DirSyncRequestControl".


Alen Alex

WM_DROPFILES in an elevated application (administrator)

$
0
0
Hello,

First of all i wnt to point out that i have read the oher similar threads before opening this thread.

My problem would be that as we know if an application is startit with administrator privilages he canot accept drag'n'drop from lower priviledged proceses like Explorer for example.

  I found out that 
ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD);
should let the the messages thru but even tho it resturns a success value it is still not working, also some ppl say that you need to all a bunch more messages for this to work.

  With this clarified my question would be if there is anyone who might know these messages?


  All help is appreciated and thx for reading!

It is nice that people help eachother

Missing api-ms-win-core-* DLLs

$
0
0

As described in question 35562218 on StackOverflow and my other question on the Microsoft Community forum (sorry - I can't post links until my account is verified) I am missing the following DLLs:

  • api-ms-win-core-libraryloader-l1-2-1.dll
  • api-ms-win-core-atoms-l1-1-0.dll
  • api-ms-win-core-winrt-error-l1-1-1.dll
  • api-ms-win-core-sidebyside-l1-1-0.dll
  • api-ms-win-core-localization-obsolete-l1-3-0.dll
  • api-ms-win-core-heap-l1-2-0.dll
  • api-ms-win-core-heap-l2-1-0.dll
  • api-ms-win-core-delayload-l1-1-1.dll
  • api-ms-win-core-libraryloader-l1-2-0.dll
  • api-ms-win-core-rtlsupport-l1-2-0.dll
  • api-ms-win-core-shlwapi-obsolete-l1-2-0.dll
  • api-ms-win-security-base-l1-2-0.dll

I've tried 'sfc /scannow', 'DISM.exe /Online /Cleanup-image /Scanhealth' and 'DISM.exe /Online /Cleanup-image /Restorehealth' to locate/fix missing files but it hasn't worked. I've got Visual C++ Redist x86 and x64 installed for 2008, 2010, 2012, 2013 and 2015 and I've got Visual Studio 2010 Express and Visual Studio 2010 Prerequisites x64 as well as Windows 7 SDK (7.0 and 7.1). I've search my entire hard drive for those DLLs but can't find them.

I've seen question "api-ms-win-core-libraryloader-l1-2-0.dll is missing" on this forum but I'm not trying to create a UWP and besides, I don't seem to have Windowsapp.lib either nor do I want it. I've seen many other posts indicating the missing DLLs should be in the C:/windows/(system32 or sysWOW64)/downlevel folder but they aren't there.

The API Sets sound like they might be what I'm looking for but I don't know where I can download those - I can only find a page telling me about them.

Surely these should be part of a library or SDK or something (other than Windowsapp.lib)? They've been mentioned as far back as Win 7. Where can I get them from?

Any constructive suggestions would be greatly appreciated (download from dodgydllwebsite.com would not be appreciated).

Windows 10 Alt+F4 Shutdown DISABLES WakeOnLAN ????

$
0
0

I have some issues concerning WakeOnLAN after updating from Win7 Pro to Win 10 Pro.

Example: I have two machines A and B.

From A I have made myself an app to wake up machine B by sending a "magic Pack" out on the network and machine B boots nicely - both under Win7 and Win10.

I then define a Remote Desktop from A to B - and it works fine.

If I want to shutdown B WHILE on the Remote Desktop, I can do it in 2 methodes:

1) Run a Shutdown -s 0, t and I have made an app as a button on the desktop on machine B for that - just click the button      and it works nice.

2) I can press Alt+F4 and choose "Shutdown" in the menu - and a warning comes up telling that if I continue the machine has to be started MANUALY on the remote site !

Method 2) seems to DISABLE WakeOnLAN on mashine B and in fact I CAN'T wake it up from machine A again.

Method 1) DON'T disable WakeOnLAN.

I think this "disabling of WakeOnLAN" is new to Windows 10 - I never had these problems under Win7.

Is there a "work around" this when using Alt-F4 for shutting down (yeah, I can use my "shutdown button" from 1) but IF the user uses Alt-F4 I would like to be able to boot machine B again by WakeOnLAN - so is there a work'around ?

I have a tool "Java_HID_Demo\Windows" tool while conecting the USB Device with VendorID and ProductID

$
0
0

 while  conecting  USB Device with  VendorID and ProductID  i am getting the response as  follows:


Connected to device VID: 8263 PID: 769
RX-->

PRESS 'S' (shift + s) to enter Debug Menu

Similar Application  I need to implement in c# or vc++ application. Please Provide if any application able get the same response.

I have tried the C# application,I able to connect the  VID and PID but not able get the response as (RX--> PRESS 'S' (shift + s) to enter Debug Menu).How to get the these response from  Device.

Please see the attached screen  Response of Java_HID_Demo tool.Similaly need to implement in c#.

Thanks & Regards,

Mohan

    


MohanV

Microsoft Authenticode Signing certificates by third party certificate authority (CA)

$
0
0

Hi!

What are the requirements/restrictions on certificates with "code signing" extension on Windows (for development purposes)? Especially for certificates with GOST cryptography (Russian algorythmes)?


-- Stanislav.

Remove title bar from dialog box created using DialogBoxIndirectParam

$
0
0

I've created a dialog box using DialogBoxIndirectParam().

But when I call SetWindowLong(hWnd, GWL_STYLE, 0), the title bar is not removed. GetLastError() returns invalid windows handle.

Is it not possible to remove title bar from dialog box?

Can someone please help me solve this?




Sameer Thigale


Microsoft ACE & Office compatibility issue

$
0
0

Here is our situation:

We have a 32 bit VC++ application that operated both with:

- Access to store data via ADO

- Excel for result output via OLE Embedded and OLE Automation

Our application is in the market of imaging.

Because of the interest of our users to work with more & bigger images, we can't stay with a 32 bit application.

We started the migration to x64 but we have a problem:

1. Data access requires Microsoft ACE OLEDB provider x64

2. Most of our users run Excel 32 bits (Microsoft continue to recommend the use of Office 32 bits).

The problem is that the Microsoft ACE OLEDB provider x64 is not compatible with Office 32 bits.

Can you please confirm?

Is there a way to workaround, for example by using another x64 OLEDB provider that would not have any issue running on the same machine as Office 32 bits?

Or maybe this is a case where Microsoft would tell us to use the x64 version of Office.

Adding ContextMenu Item(Handler) for Recent Apps in StartMenu

$
0
0

Hi ,

 I have written Context menu Handler (COM Dll).

when i right click on any Exe, on the Menu I see my new Menu item. (from Desktop or Explorer window).

When I right click on Exe, on startmenu ( Recent Apps) I dont see my new menu item.

Can anyone suggest, if I need to modify Registry, to fix the problem?

I am adding the screen shot of the Menu, where I want to add.

Thanks in advance for your help. (I am using windows 2008 R2).

Thanks

Santhi

COM out of process EXE server, toast notification, and manifest uiaccess=“true” don't work together

$
0
0

On Windows 10.1511 with Visual Studio 2015 Pro

Background:

I created a simple unmanaged C++ EXE application that:

  • Creates a Start Menu shortcut to itself (so it can send toast notifications)
  • "Registers" itself as an Out-of-Process COM server (so it's launched when toast notifications are clicked).  This is simply a LocalServer32 key under its GUID in the registry.
  • It sends a toast and exits.

When you click on the toast, my application is launched, my implementation of INotificationActivationCallback::Active is called, and I display a dialog.

This works perfectly.

Problem:

Now, instead of displaying a dialog, I want to call SendSAS().  So, I updated GPO, made the code changes, addeduiaccess=true to the manifest, compiled, signed the EXE, and placed it in the Windows\system32 directory.  The program initiates the SAS and sends toasts perfectly.  But, clicking on the toast does not launch my COM server.  Instead, an event log error is recorded:

Unable to start a DCOM Server: {x-x-x-x-x}. The error: "740"
Happened while starting this command: C:\Windows\System32\TestApp.exe -Embedding

Error 740 = "The requested operation requires elevation"

When this happens, my EXE is not launched.  It is failing some sort of Windows check before it launches the COM server EXE.

I'm certain uiaccess=true is causing the problem.

Confirmation:

If I recompile the with uiaccess=false, the COM server starts as expected and everything works perfectly (except SendSAS doesn't do anything - as expected).

Another Confirmation:

In the toast callback, I replaced SendSAS with a call to CreateProcess to launch calc.exe.  I set uiaccess=false and tested again.  When I click on the toast, Calculator is launched - no errors - perfect!  However, if I try to launch any program with uiaccess=true in its manifest, it never launches.  No event log errors, but I confirmed that CreateProcess returns 740 in this case.

My Guess:

It's not a "admin elevation" problem, and I suspect it is related to integrity levels.  I think uiaccess=true is slightly higher than medium.  Explorer.exe calls the COM server for the toasts, and it runs at medium level.  Maybe that's it?

So, I've tried to grant the COM server launch permission from lower levels as described The COM Elevation Monikor, and I tried setting "ROTFlags"=dword:00000001 without success.

Since explorer is the COM client, I can't control how it uses CoGetObject() or CoInitializeSecurity().  There is nothing I can do in the COM server because the EXE server is never launched.

Are there some settings in the registry I can set to allow this to work?  Any help is appreciated.

Thanks in advance.


-Tony

ERROR WHILE ADDING WEB REFERENCE WITH HTTPS

$
0
0
Hello ,

I added magento soap api web reference in my project (VISUAL STUDIO 2010) it is working fine with 

http://mydomain/index.php/api/v2_soap/index/?wsdl

but when i changes to

https://mydomain/index.php/api/v2_soap/index/?wsdl

it is not allowing me to get access to the service and gives the ERROR as The request was aborted: Could not create SSL/TLS secure channel.

why this is happening ? is web browser used in checking reference is OLD ?

Please help.

Is there a way to automate how the Start Menu appears, a script or something?

$
0
0

Forgive me I am not a developer, not even close. I am wondering If there might be some way to automate the way the Start Menu appears after I setup a computer for someone.

I think Microsoft made a mess of the Start Menu as it is first introduced to people.

Whenever I setup Windows 10 for someone, the first thing I do is arrange the tiles in such a way as to look a bit more organized. I make a Games group for example instead of littering games all over the menu like Microsoft does.

I am looking for a way to do this in less time. I have no idea how I would go about doing something like this but I thought I would at least Post and see if I get an answer.

Some sort of script or something that would be capable of this? I want to arrange the screen the same way every time.

Thanks if you can...

JF

Viewing all 6180 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>