Win32 Dialog Style in WPF applications

We have a WPF main application in which we use a lot of legacy Win32/ATL based dialogs through COM interfaces.  On a Windows 8.1 PC the legacy dialogs are rendered with an older looking 3D style with a gray background.  If we use the same dialogs
in a Win32 application on the same PC they get rendered with a more modern looking 2D style with a white background.  How do we tell the WPF applications to render the legacy dialogs with the newer style?  Is there some .conf setting that is missing?
AliciaV

Hi AliciaV,
>>How do we tell the WPF applications to render the legacy dialogs with the newer style?  Is there some .conf setting that is missing?
I think you need to enable Visual Styles in WPF application, this could be opened in manifest file, please refer to the following reference for more details:
#How to: Publish a WPF Application with Visual Styles Enabled
https://msdn.microsoft.com/en-us/library/hh323463.aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Win32 tooltips in WPF applications

    We have a WPF main that uses a lot of Win32/ATL dialogs through COM interfaces.  Some of the buttons have tooltips which work find if the parent is a Win32 application.  When contained in the WPF application all attempts at creating the same tooltips
    fails on the call to:
    bReturn = ::
    SendMessage(m_hwndToolTip,TTM_ADDTOOL,0,(LPARAM)
    &toolinfo);
    Any idea why this fails and how to fix it?  The full code block follows.  This is on a Windows 8.1 PC.
    // activate tooltips on icon buttons
    TOOLINFOtoolinfo;
    memset(&toolinfo,0,
    sizeof(toolinfo));
    toolinfo.cbSize =
    sizeof(toolinfo);
    toolinfo.hwnd = m_hWnd;
    toolinfo.uFlags =
    TTF_IDISHWND|
    TTF_SUBCLASS;
    toolinfo.hinst = _Module.m_hInst;
    toolinfo.uId = (
    UINT) m_hwndDelete;
    toolinfo.lpszText =
    _LSW(
    IDS_DELETE_RECORD);
    bReturn = ::
    SendMessage(m_hwndToolTip,TTM_ADDTOOL,0,(LPARAM)
    &toolinfo);
    ATLASSERT(bReturn);
    AliciaV

    Hello,
    >>When contained in the WPF application all attempts at creating the same tooltips fails on the call to:
    bReturn = ::SendMessage(m_hwndToolTip,TTM_ADDTOOL,0,(LPARAM) &toolinfo);
    I do not quite understand about you mean the same tooltips fails on the call to the SendMessage, does it throw any exception? If has, please share it with us. Or is that it runs without any exception and just SendMessage method does not return any result?
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Enumerate wifi direct devices in win32 or wpf application

    I am trying to enumerate the currently paired and visible WiFiDirect devices in a win32 or wpf application. In Windows Store app, the following code can is usedfor emumerating the WiFiDirect devices
    String^ deviceSelector = WiFiDirectDevice::GetDeviceSelector();
    OutputDebugString(deviceSelector->Data());
    create_task(DeviceInformation::FindAllAsync(deviceSelector)).then([this] (task<DeviceInformationCollection ^> resultTask)
    Are there any equivalent APIs for a win32 or wpf app?

    Hi,
    Unfortunately, it seems that there is no method available to enumerate paired WiDi device profiles through non WinRT apps.
    Alternatively, you can consider the method described in the below link to create a helper DLL which can do the work for you:
    http://www.wintellect.com/devcenter/jeffreyr/using-the-windows-runtime-from-a-non-metro-application
    A second alternative could be writing the device profiles to a XML from WinRT app and reading it from desktop app.
    (Please mark as answer if this resolves your query. Please upvote if this post is helpful.)
    Regards,
    Rajesh

  • WPF Styles and WPF Crystal Reports viewer

    Hi,
    We are currently developing a WPF application which will utilize Styles created with Expression Blend.
    Our environment is VS2010 SP1 and Crystal Reports for VS2010 SP2.
    We want to design our reports with Crystal Reports but we don't seem to find any documentation or topics about integrating WPF Styles with the current WPF Crystal Reports Viewer.
    So I was wondering if somebody here already tried to use WPF styles with the WPF CR Viewer.
    If so, how does it basically work?
    Thank you in advance.

    Hello Alan
    This morning I got a short note on the issue from Program Management. In a nut shell this is what they say:
    ..at this time the WPF viewer doesn't expose support for styles and the best thing will a post
    to the idea on [SAP IdeaPlace|SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]. Based on the interest level expressed there the PM group will make a decision on how best to proceed.
    Obviously, this is not going to be a swift process, but at least something...
    - Ludek

  • How to change the TAB style of an application

    Hi,
    I have an application which was initially created using "One Level of Tabs". Now we require "Two Level of Tabs".
    Is there some way of changing the Tab style of the application.
    Thanks in advance,
    Monika

    Just forgot to mention that i want the already existing tab set to become the Parent tab set and then i should be able to create the standard tab set for each of the tabs in the parent tab set.
    Thanks in advance
    Monika

  • Issue with worksheet.Select(true) after hosting Excel window in WPF application

    The issue is with Office 2013.
    We are hosting excel workbook window in WPF application using HwndHost class. In overridden BuildWindowCore method of HwndHost class, we are creating a MDICLIENT Window and setting this MDICLIENT window handle as parent for Excel
    main window handle and returning HandleRef object of MDICLIENT window handle from BuildWindowCore method.
    Once HwndHost control is loaded, we are selecting sheet of excel in the loaded event of HwndHost control. The code for selection of sheet is given below.
    dynamic workSheet =
    this.excelApplication.Workbooks[1].Worksheets[sheetName];
    this.excelApplication.Workbooks[1].Activate()
    workSheet.Activate();
    workSheet.Select(true);
    The first time execution of
    workSheet.Select(true)
    halt for few seconds and then it throws exception “System.Runtime.InteropServices.ComException”
    with message “The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))”.
    But it executes successfully without delay on subsequent calls. Sometimes the execution halt for minutes on different Systems.
    This absurd behaviour is seen only once in application instance life time and that too after excel window gets loaded in WPF application. If we execute
    workSheet.Select(true)
    before loading of window then it executes properly. Once
    workSheet.Select(true)
    executed for first time with exception, it executes successfully without delay on subsequent calls.

    No, I dont have any macro in the sheet and it is happpening with all workbooks. The problem is consistent with all workbooks and also it throws exception only for first time in the application. If I execute it again in same application instance, it works
    properly.

  • Should I use "Windows Forms Application" or "WPF Application" or ..... ?

    Hi everybody!
    I want to become a master programmer.
    I want to programming "Windows Desktop"  
    I am using Visual Studio Ultimate 2013 by language C# on  Windows 8 OS
    I am confusing because Should I use "Windows Forms Application" or "WPF Application" or .....?
    which one is better?
    Help me!!!!!!!! Please!!!!!
    Thanks a lot!
    if possible, please send me "step by step exercises about the WPF Application to email: [email protected]
    thanks again

    Although I don't have much experience with WPF, only Windows Forms, this blog post might shed some light on which decision you should make:
    http://rachel53461.wordpress.com/2012/10/12/switching-from-winforms-to-wpfmvvm/
    If you are looking to just add a quick and dirty UI on top of a small script or executable tool, Windows Forms would be the answer, as it is very easy to learn and use. However, since you have the best tools currently available, and you say you want to do
    it the right way, I would say learn WPF now. You will benefit from it later on.

  • XAML Design window wont open in C# WPF application

    I am currently following some C# tutorials on MVA.
    we have just moved from console applications to WPF applications.
    For some reason the Designer doesnt open when I create a new project. I get the code screen but not the form designer half (see Below).
    I can give a link to the onedrive folder, but for some reason i am unable to post links or pictures.
    This is a clean install of VS express 2013 so no settings have been changed. (or set up..)
    Any help or suggestions would be greatly appreciated.
    Thanks!

    Hello Matt,
    The image shows it is a xml file. Can you open your MainWindows to test in your first image? I can see your second image seems do not have problem.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Application Icon are not displayed during Clickonce installation in WPF Application

    During Clickonce installation of WPF application, Icon File(ico) is not displayed in the start Menu and installed applications list in control panel..
    Default icon only gets displayed.
    In my project 
    Already added ico file in the "Icon and Manifest" in Application Properties. 
    Please answer me how to show Application Icon in the Start Menu as well as in installed applications in control panel

    Did you do this:
    http://learnwpf.com/post/2012/07/09/Adding-an-Icon-and-File-Association-to-WPF-Clickonce-Applications.aspx
    You also set the ico file as the project icon.
    Since that's under the Icon and Manifest I guess you did that.
    Also
    The main window ought to have it's icon set to thee icon.
    The main window is the first window you open - which of course may or may not be called MainWindow.
    Hope that helps.
    Recent Technet articles:
    Property List Editing ;  
    Dynamic XAML

  • Entity Framework in WPF Application - Using Statement or Implement IDisposable

    I have a WPF application that uses Entity Framework.
    I have implemented a Repository that implements IDisposable, that holds my EF context.  When the application starts up I new up a Repository, which news up an EF context, then when the application shuts down, I dispose of my Repository, which disposes
    the EF context as well.
    The end result is that my context remains open during the entire lifetime of the application.  
    I've been reading up on EF, and all the examples put the operations against the EF context in a using statement.  Is that the preferred approach?  What is the priority: to keep the context open briefly, or just to make sure you properly dispose
    of it when you're finished with it.
    Thanks.
    Aaron

    >
    https://msdn.microsoft.com/en-us/library/aa355056(v=vs.110).aspx
    That link is only for WCF and it's broken implementation of the Dispose pattern.
    >I have been burnt in doing it where the connection was not closed or disposed when it short-circuted out of the Using statement on exception
    If so, it was a bug.  You should expect that not to happen.
    'using' will close your connection, unless the connection was open before the DbContext and was passed in.  'using' is the safest way to ensure that the connections are closed in a timely manner.
    David
    David http://blogs.msdn.com/b/dbrowne/
    I absoultly do not agree with you. I have been burnt in using the Using statment. And it was along the lines that an excpetion was thrown within the Using statement and no closing of the connection or dispoiong of it ever occured, which is what the WCF example
    is showing on how a Using statement can be short-circuted and things can go wrong.
    I don't care if the Using statement issue is being shown on a WCF typed cleint. I do the same thing in using straight up ADO.NET or EF, becuase I have been burnt by the Using statement, and I dont use them to open,  close or dispose of a connection.

  • Submitt request to SQL table using C# WPF Application

    I would like to submit request from WPF application to SQL table. My source is SharePoint list.
    I am using Visual Studio 2008 for getting the Data from SharePoint List.
    At the bottom I have Submit button which I want to use for inserting data into SQL table.
    Below code is working fine for getting the data from SharePoint list. cmdGetRequests Button is working fine
    I am new in programming any help be appreciated.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using RequestsApp.WingtipSite;
    using System.Data.SqlClient;
    namespace RequestsApp
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class
    Window1 : Window
    public Window1()
                InitializeComponent();
    private void cmdGetRequests_Click(object sender,
    RoutedEventArgs e)
    InformationGatewayDataContext dc =
    new InformationGatewayDataContext(
    new Uri("https://organization.xx./_vti_bin/ListData.svc"));
                dc.Credentials = System.Net.CredentialCache.DefaultCredentials;
    var source = dc.Requests;
                listBox1.Items.Clear();
    foreach (var dev
    in source)
    string devName = dev.ID +
    " " + dev.FT + " " + dev.TX +
    " " + dev.EG +
    " " + dev.CompanyName + " " + dev.EmailAddr +
    " " + dev.Flag +
    " " + dev.StatusDate + " " + dev.Date +
    " " + dev.Priority +
    " " + dev.Source;
                    listBox1.Items.Add(devName);
    private void cmdSendRequests_Click(object sender,
    RoutedEventArgs e)
    simam

    Thank you for the giving me right direction. I am able to get the list from SharePoint list into WPF application and submit data to SQL table.
    Now I need to have Delete button which will delete the SharePoint list data. and then exit the application.
    my Delete button is not working , I am using below code for deleting the list data
    private void cmdDeleteRequests_Click(object sender,
    RoutedEventArgs e)
    InformationGatewayDataContext dc =
    new InformationGatewayDataContext(
    new Uri("https://organization.xx./_vti_bin/ListData.svc"));
                dc.Credentials = System.Net.CredentialCache.DefaultCredentials;
    var source = dc.Requests;
                listBox1.Items.Clear();
    foreach (var dev
    in source)
    string devName = dev.ID +
    " " + dev.FT + " " + dev.TX +
    " " + dev.EG + " " + dev.CompanyName +
    " " + dev.EmailAddr + " " + dev.Flag +
    " " + dev.StatusDate + " " + dev.Date +
    " " + dev.Priority +
    " " + dev.Source;
                    listBox1.Items.Add(devName);
    simam

  • Unable to connect to wpf application using SQLEXPRESS 2012

    Hi,
    I am currently working on WPF project that uses SQLEXPRESS 2012 DB and EF 5.0. 
    I was able to connect to the DB when it was hosted on the same PC. I now hosted the DB to a differernt PC and trying to access it through WPF app, but getting the error as "The underlying provider failed to open". I went through various forums
    to fix the issue but none of the solutions provided resolved the issue. Below is my connection string
     <add name="SAPActivityContext" connectionString="metadata=res://*/SapEntity.csdl|res://*/SapEntity.ssdl|res://*/SapEntity.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.0.100\SQLEXPRESS;initial
    catalog=Sap;persist security info=True;user id=sa;password=Pass@word7;MultipleActiveResultSets=True;&quot;" providerName="System.Data.EntityClient" />
    The connection string has been refactored based on the various inputs provided in different forums.
    Please help.

    Hi Priyankaks,
    According  your description, you fail to connect to a SQL Server 2012 Express database from WPF application. Cloud you please post the full error message for further analysis? You can check Windows Event Viewer or SQL Server Error log to see
    if there is additional information.
    From my knowledge, the error “The underlying provider failed on Open” always occurs when the connection string is incorrect. I recommend you create a surely working connection string via the following method.
    Create a new project, add your Entity Framework Data Model and select your required connection, click “Test Connection” to get a working connection string. Then copy and paste the connection string in the web/app.config of your own project. For more
    details, please review this similar
    thread.
    There is also a blog about error “The underlying provider failed on Open“in Entity Framework application
    for your reference.
    http://blogs.msdn.com/b/dataaccesstechnologies/archive/2012/08/09/error-quot-the-underlying-provider-failed-on-open-quot-in-entity-framework-application.aspx
    Thanks,
    Lydia Zhang

  • Detecting if WPF application is visible on screen

    Hi gents, I have made an WPF application that reads data from an external device using the serial port and then visualizes it. Now, I would like to avoid reading data from the serial port when the application is not visible on the screen, thus there is no
    need to read data which is time consuming. So can someone please advice on how to check if the application (mainWindow) is visible or not. I have tried to make use of events such as isActive, isVisible etc. but none of the ones I tried work. I will be happy
    with a solution where the application is recognized as visible if just a pixel of it is visible on the screen.
    Best Regards
    Tom

    A window doesn't need to have focus or be "active" to be in view.
    That means Magnus approach is only going to work if you want it to function only whilst the user gives it focus.
    For example.
    I have 5 windows open and parts of 3 of them visible at the moment.
    Two are not minimised but are behind others.
    IPlayer doesn't have focus and I'm listening to radio 2.
    This is somewhat easier if your user will only have one monitor.
    Please take a look at the following thread:
    http://stackoverflow.com/questions/2465646/how-do-i-know-what-monitor-a-wpf-window-is-in
    bool onPrimary = this.Bounds.IntersectsWith(Screen.PrimaryScreen.Bounds);
    If all you're trying to save is processing then handling statechanged for minimize and switch might be something to consider.
    This is non trivial though:
    http://stackoverflow.com/questions/926758/window-statechanging-event-in-wpf
    Hope that helps.
    Recent Technet articles:
    Property List Editing ;  
    Dynamic XAML

  • Error when startup WPF Application with Crystal Report !

    Hi!
    I have an error when build & run a WPF Application with Crystal Report. Can anyone help me ?
    First, I created 2 project, one is the WPF Application & one is Shell Start Up project (to show loading screen, then show main window when loaded, is WPF Application too)
    WPF Application:
    /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window {
            public MainWindow() {
                InitializeComponent();
               // crViewer is SAPBusinessObjects.WPF.Viewer.CrystalReportsViewer
                crViewer.ViewerCore.ReportSource = new CrystalReport1(); // Assign report to viewer
    Shell Startup:
    [STAThread]
            public static void Main(string[] args) {
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
                Application app = new Application();
                ShowLoadingWindow(); // Show loading screen
                MainWindow mw = new MainWindow();
                mw.Show();
                app.Run();   
            static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) {
                // Exception was throw here
    And here is the exception & it's stack trace
    Message:  Object reference not set to an instance of an object.
    Stacktrace:
    at SAPBusinessObjects.WPF.Viewer.ViewerCore.<>c__DisplayClass1.<set_ReportSource>b__0()
       at SAPBusinessObjects.WPF.Viewer.DelegateMarshaler.<>c__DisplayClass29.<QueueOnThreadPoolThread>b__28(Object )
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       at System.Threading.ThreadPoolWorkQueue.Dispatch()
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

    As far as I know the error is typically due to the fact that I'm trying to address an object that has not been set. E.g.; this could be due to  bad scoping, bad inits/constructs, trying to access a member of a class without instance object and so on. I suspect this is a design \ code issue. You might be able to confirm this using [Process Monitor|http://technet.microsoft.com/en-ca/sysinternals/bb896645.aspx].
    Other than that, I'd recommend creating a phone case here:
    http://store.businessobjects.com/store/bobjamer/en_US/pd/productID.98078100?resid=S6I@hgoHAkEAAGsiyVkAAAAR&rests=1282226845369
    - Ludek

  • VI analyzer and dialog-style control.

    When using VI analyzer it comes up with an occurance that states "The control labeled "whatever" is not a dialog-style control. Because of this, its appearance will not be platform-specific." What is the significance of this message and the pros and cons of not using controls from the system pallette.
    Using LV 8.2 and TS 3.5
    Using LabVIEW 2010SP1 and TestStand 4.5

    Use the controls from the System palette when you want your UI to look like standard dialog UIs in your operating system.  For analyzing any other kinds of VIs (test VIs, subVIs, instrument panel VIs, palette VIs, etc.), you should deselect this VI Analyzer test to reduce the amount of "noise" in your results.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

Maybe you are looking for

  • Subclassing a Java Class in JRuby

    Hello, everyone. I'm studying JRuby by writing a minimal Swing app in Ruby. It seems to be an effective way of finding Ruby <-> Java integration issues. ;) I am trying to create a subclass of AbstractAction for a button whose name will be "Quit" and

  • SAX Parser in OC4J

    I'm trying to read a XML file in an EJB using a SAX parser. I tried the following statement to create the reader XMLReader xr = XMLReaderFactory.createXMLReader("oracle.xml.parser.v2.SAXParser"); but I obtain the following exception: java.lang.ClassN

  • Mail jam

    I apparently irritated my mail program by trying to send a message with an overly large attachment. The offending file is in the Draft list. If I so much as try to select it (in order to get it to Trash), I get the dred "spinning beach ball of death.

  • Error message (49) when installing trial version of Photoshop

    I have just been trying to download Photoshop onto a Windows 8 laptop and at the very end of the process, it came up with a message saying 'Download Error. Press Retry to try again or contact customer support (49). Can anyone advise me how to rectify

  • Resource Availability - for next Shift only when required

    Hi Gurus, How the Resources can be made available for the 2nd/3rd shift, only during a certain period. Resource should be made available for 2nd/3rd Shift as and when required period Since the requirement for the shift is not sure during the Master D