Windows handle from C++ question

Hi,
I am showing a frame/panel/ (non canvas) Java component from a C++ application.
I have been looking for information about this but I found no information about obtaining the window handle and/or hdc of the opened window...
I need to embed this frame/panel in a "Windows window" :-)
Is it possible?
Thanks,
Katarn

Hi,
I need to do exactly the same as you mentioned and am not sure of how to go about it.Would it be possible to send me a small demo code of how to embed JavaWindows in Native(C++)windows.
It really would be a great help
Thanx in advance,
mickoo

Similar Messages

  • Getting a Windows Handle from an Applet

    how can i do it using jdk1.3? i looked thru the documentation and i didnt see anything. (hopefully i missed something)...thx...sonny

    Which window handle your talking about? Browser window?
    If so use the netscape.javascript pacakage
    import netscape.javascript.*;
    JP

  • How to Use AccessibleObjectFromWindow API in VBA to Get Excel Application Object from Excel Instance Window Handle

    I need to get the Excel.application object from a window handle using AccessibleObjectFromWindow. I can't seem to make the code work. First, I successfully search for the XLMAIN windows. Then, when I get a handle, I execute the AccessibleObjectFromWindow
    function. It seems to return a value of -2147467262 in all cases. Therefore, I believe that it is returning an error value. I can't figure out how to determine the meaning of this value.
    If it is an error value, I believe that one or more arguments are in error. My best guess at present is that the GUID argument is incorrect. I have tried two GUID values: {00020400-0000-0000-C000-000000000046} and {90140000-0016-0409-0000-0000000FF1CE}.
    I have seen both used in conjunction with OBJID_NATIVEOM. Neither one seems to work. I really would prefer not to use the second one as it has an Excel major and minor version number. I would hate to have to change this code, if a new minor version appeared.
    The attached code has been commented to show which parts have been shown to work and which not. I'm at my wits end and really need help.
    Thanks
    'This module is located in Access 2010, but this is an Excel question.
    Option Compare Database
    Option Explicit
    ' Module-Level Declarations
    'The GetDesktopWindow function and FindWindowEx function work just fine.
    Public Declare Function GetDesktopWindow Lib "user32" () As Long
    Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Long, _
    ByVal hWnd2 As Long, _
    ByVal lpsz1 As String, _
    ByVal lpsz2 As String) _
    As Long
    'I'm not getting the expected output from this function (see below)
    Private Declare Function AccessibleObjectFromWindow& Lib "oleacc.dll" _
    (ByVal hwnd&, _
    ByVal dwId&, _
    riid As GUID, _
    xlwb As Object)
    Type GUID
    lData1 As Long
    iData2 As Integer
    iData3 As Integer
    aBData4(0 To 7) As Byte
    End Type
    Function ExcelInstances() As Long
    ' Procedure-Level Declarations
    ' Value of OBJID_NATIVEOM verified by checking list of Windows API constants _
    on this site: http://www.lw-tech.com/q1/base.htm
    Const OBJID_NATIVEOM = &HFFFFFFF0
    Dim hWndDesk As Long 'Desktop window
    Dim hWndXL As Long 'Child window
    Dim objExcelApp As Object 'Final result wanted: Excel application object
    'Following variable (xlapp) to be set by AccessibleObjectFromWindow function
    Dim xlapp As Object
    Dim IDispatch As GUID 'GUID used in call to AccessibleObjectFrom Window function
    'Set up GUID to be used for all instances of Excel that are found
    Dim tmp1 As Variant 'Return value from AccessibleObjectFromWindow
    ' Executable Statements
    SetIDispatch IDispatch
    IDispatch = IDispatch
    'Get a handle to the desktop
    hWndDesk = GetDesktopWindow 'This seems to work
    Do
    'Get the next Excel window
    'The following statement seems to work. We are finding and counting _
    correctly all the instances of Excel. hWndXL is non-zero for each _
    instance of Excel
    hWndXL = FindWindowEx(GetDesktopWindow, hWndXL, "XLMAIN", vbNullString)
    'If we got one, increment the count
    If hWndXL > 0 Then
    'This works. We correctly count all _
    instances of Excel
    ExcelInstances = ExcelInstances + 1
    'Here is the problem. The following statement executes and returns a value of _
    -2147467262. xlapp, which is passed by reference to AccessibleObjectFromWindow, _
    is set to nothing. It should be set to the object for Excel.application. _
    I believe that this value is not an object. I tried to reference tmp1. in the _
    immediate window. There was no Intellisense.
    'I think that the function in returning an error value, but I can't figure _
    out what it is. I believe that AccessibleObjectFromWindow returns error _
    values, but I don't know where to find their values so I can interpret the _
    function's results.
    'As best I can tell, the hWndXL parameter is correct. It is the handle for _
    an instance of Excel. OBJID_NATIVEOM is set correctly (see constant declaration _
    above). xlapp is passed by reference as a non-initialized object variable, which _
    will be set by AccessiblObjectFromWindow. IDispatch may be the problem. It is set _
    as shown below in the procedure SetIDispatch(ByRef ID As GUID). This procedure _
    appears to work. I can see that IDispatch is set as I intended and correctly _
    passed to AccessibleObjectFromWindow.
    tmp1 = AccessibleObjectFromWindow(hWndXL, OBJID_NATIVEOM, IDispatch, xlapp)
    'Need to write code to test tmp1 for error. If none, then set objExcelApp = _
    object. Also, I exect xlapp to be set to Excel.application
    End If
    'Loop until we've found them all
    Loop Until hWndXL = 0
    End Function
    Private Sub SetIDispatch(ByRef ID As GUID)
    'Defines the IDispatch variable. The interface _
    ID is {90140000-0016-0409-0000-0000000FF1CE}.
    'NOT USING {00020400-0000-0000-C000-000000000046}, _
    which could be the problem
    '9 is release version - first version shipped (initial release)
    '0 is release type - retail/oem
    '14 is major version
    '0000 is minor version
    '0016 is product ID - MS Excel 2010
    '0409 is language identifier - English
    '0 is x86 or x64 - this is x86
    '000 reserved
    '0 is debug/ship
    '000000FF1CE is office family ID
    With ID
    .lData1 = &H90140000
    .iData2 = &H16
    .iData3 = &H409
    .aBData4(0) = &H0
    .aBData4(1) = &H0
    .aBData4(2) = &H0
    .aBData4(3) = &H0
    .aBData4(4) = &H0
    .aBData4(5) = &HF
    .aBData4(6) = &HF1
    .aBData4(7) = &HCE
    End With
    End Sub
    DaveInCalabasas

    I don't think you can return a reference to Excel's main window like that as you are attempting to do.
    Ref:
    http://msdn.microsoft.com/en-us/library/windows/desktop/dd317978(v=vs.85).aspx 
    It's relatively straightforward to return any workbook's window in any given instance, and in turn it's parent Excel app. Try the following and adapt as required (and include error handling) -
    Option Explicit
    Private Declare Function FindWindowEx Lib "User32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
    ByVal lpsz2 As String) As Long
    Private Declare Function IIDFromString Lib "ole32" _
    (ByVal lpsz As Long, ByRef lpiid As GUID) As Long
    Private Declare Function AccessibleObjectFromWindow Lib "oleacc" _
    (ByVal hWnd As Long, ByVal dwId As Long, ByRef riid As GUID, _
    ByRef ppvObject As Object) As Long
    Private Type GUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    Data4(7) As Byte
    End Type
    Private Const S_OK As Long = &H0
    Private Const IID_IDispatch As String = "{00020400-0000-0000-C000-000000000046}"
    Private Const OBJID_NATIVEOM As Long = &HFFFFFFF0
    Sub test()
    Dim i As Long
    Dim hWinXL As Long
    Dim xlApp As Object ' Excel.Application
    Dim wb As Object ' Excel.Workbook
    hWinXL = FindWindowEx(0&, 0&, "XLMAIN", vbNullString)
    While hWinXL > 0
    i = i + 1
    Debug.Print "Instance_" & i; hWinXL
    If GetXLapp(hWinXL, xlApp) Then
    For Each wb In xlApp.Workbooks
    Debug.Print , wb.Name
    Next
    End If
    hWinXL = FindWindowEx(0, hWinXL, "XLMAIN", vbNullString)
    Wend
    End Sub
    'Function GetXLapp(hWinXL As Long, xlApp As Excel.Application) As Boolean
    Function GetXLapp(hWinXL As Long, xlApp As Object) As Boolean
    Dim hWinDesk As Long, hWin7 As Long
    Dim obj As Object
    Dim iid As GUID
    Call IIDFromString(StrPtr(IID_IDispatch), iid)
    hWinDesk = FindWindowEx(hWinXL, 0&, "XLDESK", vbNullString)
    hWin7 = FindWindowEx(hWinDesk, 0&, "EXCEL7", vbNullString)
    If AccessibleObjectFromWindow(hWin7, OBJID_NATIVEOM, iid, obj) = S_OK Then
    Set xlApp = obj.Application
    GetXLapp = True
    End If
    End Function
    Note as written if an instance does not have any loaded workbooks a reference will not be returned (though a workbook can be added using DDE, but convoluted!)
    FWIW there are two other very different approaches to grab all running Excel instances though something along the lines of the above is simplest.
    Peter Thornton

  • Why i'm getting exception InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created ?

    I have a backgroundworker1 dowork event and inside:
    private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
    BackgroundWorker bgw = (BackgroundWorker)sender;
    if (bgw.CancellationPending == true)
    return;
    else
    this.BeginInvoke(new MethodInvoker(delegate
    timer1.Stop();
    Button1Code();
    timer1.Start();
    trackBar2.Enabled = false;
    trackBar1.Enabled = false;
    while (true)
    bitmaps = ImagesComparison.get_images_with_clouds(b1);
    for (int i = 0; i < bitmaps.Length; i++)
    ConvertTo1or8Bit.BitmapToGIF(bitmaps[i], @"c:\convertedgifs\" + i.ToString("D6") + ".gif");
    break;
    The exception is on the BeginInvoke part.
    In the last few days i was running the program many times and i didn't have this exception even once.
    And now every times i'm running it i'm getting the exception.
    System.InvalidOperationException was unhandled by user code
    HResult=-2146233079
    Message=Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
    Source=System.Windows.Forms
    StackTrace:
    at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
    at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args)
    at System.Windows.Forms.Control.BeginInvoke(Delegate method)
    at mws.ScanningClouds.backgroundWorker1_DoWork(Object sender, DoWorkEventArgs e) in d:\C-Sharp\Download File\Downloading-File-Project-Version-012\Downloading File\ScanningClouds.cs:line 715
    at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
    at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
    InnerException:
    Line 715 is: this.BeginInvoke(new MethodInvoker(delegate

    Where are you starting the background worker from?  Possibly the constructor of the form?
    It would be greatly appreciated if you would mark any helpful entries as helpful and if the entry answers your question, please mark it with the Answer link.

  • Window inheritance problem, implementation question

    This is a multi-part message in MIME format.
    --------------F5AF60803BB8EFA34C8D4288
    Content-Type: multipart/alternative;
    boundary="------------24CDBE5DFBEC0C4205C15C80"
    --------------24CDBE5DFBEC0C4205C15C80
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    Hi!
    I have a window inheritance and implementation question. I'm using
    Forte 3.0.J.1.
    I have a super (base) window with a PushButton on it. I want to
    handle the Click event of the button in this super window therefore
    I create an event handler.
    <MyBtn> : PushButton
    I create a sub window inheriting from the previous super window.
    I put some data widgets on it and group all of them (the inherited
    button as well) into a GridField. When I set the mapped type of the grid
    the name of the inherited PushButton widget changes:
    <MainGrid.MyBtn> : PushButton
    When I run the application I get a SystemException with the
    message:
    Attempt to register an event on a NIL object (qqds_C_FieldWidget, 10).
    Traceback:
    SuperWindow.EH at line 0
    SubWindow.Display at line 5
    C++ Method(s)
    UserApp.Run at offset 105
    It is quite understandable that in runtime there is no widget called
    <MyBtn>
    and the event handler of the super class fails.
    But what I don't know : after specifing a mapped type of a GridField why
    changes
    the name of those widgets that haven't got mapped type e.g.: PushButton,
    PictureButton etc.
    How to solve this situation?
    I made a sall example which i send in attachment.
    Thanks for any help and advice in advance...
    Attila Racz Lufthansa Systems
    Hungary
    BUD LSYH
    E-mail: [email protected] .-``'.
    Tel.: (36 1) 431-2910 .` .' Mazsa ter 2-6.
    Fax : (36 1) 431-2977 _.-' '._ H-1107 Budapest,
    Hungary
    --------------24CDBE5DFBEC0C4205C15C80
    Content-Type: text/html; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <tt>    Hi!</tt><tt></tt>
    <p><tt>I have a window inheritance and implementation question. I'm using</tt>
    <br><tt>Forte 3.0.J.1.</tt><tt></tt>
    <p><tt>I have a super (base) window with a PushButton on it. I want to</tt>
    <br><tt>handle the Click event of the button in this super window therefore</tt>
    <br><tt>I create an event handler.</tt><tt></tt>
    <p><tt>&lt;MyBtn> : PushButton</tt><tt></tt>
    <p><tt>I create a sub window inheriting from the previous super window.</tt>
    <br><tt>I put some data widgets on it and group all of them (the inherited</tt>
    <br><tt>button as well) into a GridField. When I set the mapped type of
    the grid</tt>
    <br><tt>the name of the inherited PushButton widget changes:</tt><tt></tt>
    <p><tt>&lt;MainGrid.MyBtn> : PushButton</tt><tt></tt>
    <p><tt>When I run the application I get a SystemException with the</tt>
    <br><tt>message:</tt><tt></tt>
    <p><tt>Attempt to register an event on a NIL object  (qqds_C_FieldWidget,
    10).</tt>
    <br><tt>      Traceback:</tt>
    <br><tt>          SuperWindow.EH
    at line 0</tt>
    <br><tt>          SubWindow.Display
    at line 5</tt>
    <br><tt>          C++ Method(s)</tt>
    <br><tt>          UserApp.Run
    at offset 105</tt><tt></tt>
    <p><tt>It is quite understandable that in runtime there is no widget called
    &lt;MyBtn></tt>
    <br><tt>and the event handler of the super class fails.</tt><tt></tt>
    <p><tt>But what I don't know : after specifing a mapped type of a GridField
    why changes</tt>
    <br><tt>the name of those widgets that haven't got mapped type e.g.: PushButton,</tt>
    <br><tt>PictureButton etc.</tt><tt></tt>
    <p><tt>How to solve this situation?</tt>
    <br><tt>I made a sall example which i send in attachment.</tt><tt></tt>
    <p><tt>Thanks for any help and advice in advance...</tt><tt></tt>
    <p><tt>---------------------------------------------------------------------------</tt>
    <br><tt> Attila Racz                                    
    Lufthansa Systems Hungary</tt>
    <br><tt>                                                
    BUD LSYH</tt>
    <br><tt>E-mail: [email protected]      
    .-``'.</tt>
    <br><tt>Tel.: (36 1) 431-2910               
    .`   .'     Mazsa ter 2-6.</tt>
    <br><tt>Fax : (36 1) 431-2977           
    _.-'     '._    H-1107 Budapest, Hungary</tt>
    <br><tt>---------------------------------------------------------------------------</tt>
    <br><tt></tt> </html>
    --------------24CDBE5DFBEC0C4205C15C80--
    --------------F5AF60803BB8EFA34C8D4288
    Content-Type: application/x-zip-compressed;
    name="Inh.zip"
    Content-Transfer-Encoding: base64
    Content-Disposition: inline;
    filename="Inh.zip"
    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
    --------------F5AF60803BB8EFA34C8D4288--

    import javax.swing.JOptionPane;
    public class Test{
         public static void main(String[] args)
              String newItem = "Item";
              float newSerial = 4234;
              float newCode = 3424;
              int newBase = 1000;
              boolean YesWarranty = true;
              boolean NoWarranty = true;
              Machinery test1 = new Machinery(newItem, newCode, newSerial, newBase, YesWarranty, NoWarranty);
              JOptionPane.showMessageDialog(null, "Item: " + test1.getItem() + " Serial: " + test1.getSerial() + " Code: " + test1.getCode()
              + " Warranty: " + test1.IncludeWarranty() + " No Warranty: " + test1.ExcludeWarranty()+ " Base: " + test1.getPrice());
    }Tested with this and it seems to be ok?
    Changed my final code too because it seemed to always add the 10% whether YesWarranty was true or false, so made it
              if (TrueWarranty==true) //There is a warranty, it returns the base price plus 10%
                   return (base+((base/100)*10));May have posted here too early if it does work, but there is another part so if ive trouble with that il be back :P
    Edited by: dave_the_bear on 16-Nov-2010 07:17
    Changed base to double and used the *0.1 method

  • Management of window handles across sessions

    Hi All,
    I have a single menu navigation html(image icon per module) for my application modules. Can this navigation menu be used across the new browser sessions created. i.e, the menu need to be having the window handles of all the sessions created on a client m/c.
    Can I acess the window handle in javascript of one session from another session?
    Its ok even if it is IE specific.
    Thanks
    Venu.

    I think the question from me is not clear. For an Application instance, I have the window handles available in the application. What if I open 2 application instances and I need to communicate one window handle of one application instance to another window handle of another application instance...This clearly communicates that these 2 applications are 2 separate session instances. Is it knowing the window names on the client m/c helps...can I get window handle in this case?
    Thanks

  • Unable to connect to Oracle database running on Windows machine from linux.

    Hi,
    I'm not able to connect to oracle database running on Windows machine from Linux machine. I'm geting the below mentioned error. I have given below the code I used to connect to database and database propertes.Do I need to use any specific driver?
    Please help me.
    Thanks,
    Sunjyoti
    Code :
    import oracle.jdbc.pool.OracleDataSource;
    import java.sql.Connection;
    import java.util.*;
    import java.sql.*;
    import java.io.*;
    class try2{
    public static void main(String args[]) {
    try {
              System.out.println("hi");
    // Load the properties file to get the connection information
    Properties prop = new Properties();
    prop.load(new FileInputStream("/home/sreejith/EDIReader/Connection.properties"));
    // Create a OracleDataSource instance
    OracleDataSource ods = new OracleDataSource();
    System.out.println("prop is "+prop);
    configureDataSource(ods, prop);
    Connection conn=null;
    // Create a connection object
    conn = ods.getConnection();
         System.out.println("Connection is"+conn);
    // Sets the auto-commit property for the connection to be false.
    conn.setAutoCommit(false);
    } catch (SQLException sqlEx){ // Handle SQL Errors
    System.out.println("In exception "+sqlEx);
    } catch(Exception excep) { // Handle other errors
    System.out.println(" Exception "+ excep.toString());
    private static void configureDataSource(OracleDataSource ods, Properties prop) {
    // Database Host Name
    ods.setServerName(prop.getProperty("HostName"));
    // Set the database SID
    ods.setDatabaseName(prop.getProperty("SID"));
    // Set database port
    ods.setPortNumber( new Integer( prop.getProperty("Port") ).intValue());
    // Set the driver type
    ods.setDriverType ("thin");
    // Sets the user name
    ods.setUser(prop.getProperty("UserName"));
    // Sets the password
    ods.setPassword(prop.getProperty("Password"));
    Connection properties :
    # Your Database Connection details
    HostName = 10.20.3.19
    SID = EDIREAD
    Port = 1521
    UserName = dbuser
    Password = dbuser
    Error I'm getting is
    error while trying to connect with odbc datasource
    [root@iflexpau2217 EDIReader]# java try2
    hi
    prop is {HostName=10.20.3.19, Password=dbuser, UserName=dbuser, SID=EDIREAD, Port=1521}
    In exception java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    Also I tried to connect with weblogic JDBC driver
    Code is here:
    import java.io.BufferedReader;
    import java.io.ByteArrayInputStream;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    //import com.entrust.toolkit.util.ByteArray;
    public class trial{
         public static void main(String args[]) throws IOException{
              System.out.println("hi");
              Connection p_conn = null;
              PreparedStatement xml_insert = null;
              try {
         // Load the JDBC driver
                   System.out.println("hi2");
         // String driverName = "oracle.jdbc.driver.OracleDriver";
    String driverName = "weblogic.jdbc.oracle.OracleDriver";
         System.out.println("hi2");
         Class.forName(driverName);
         // Create a connection to the database
         String serverName = "10.20.3.19";
         String portNumber = "1521";
         String sid = "EDIREAD";
         //String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
    String url = "jdbc:bea:oracle://10.20.3.19:1521";
         String username = "dbuser";
         String password = "dbuser";
    System.out.println("connection is:"+p_conn+"user name is"+username+"password is"+password);
         p_conn = DriverManager.getConnection(url, username, password);
         System.out.println("connection is:"+p_conn+"user name is"+username+"password is"+password);
              xml_insert=p_conn.prepareStatement("insert into PRTB_SUBUNIT (SUBUNT_ID,SUBUNT_SUB_UNIT,SUBUNT_PHYUNT_ID) values (?,?,?)");
              //InputStream in=null;
              File l_file=new File("/home/sreejith/EDIReader/propertyfiles/inputfile/BUG_10802_ES_CSB19_68.txt");
              BufferedReader input =null;
              input=new BufferedReader(new FileReader(l_file));
              String line = null;
              StringBuffer trial=new StringBuffer();
              while (( line = input.readLine()) != null){
                   trial.append(line);
                   trial.append(System.getProperty("line.separator"));
              //InputStream is = new BufferedInputStream(new FileInputStream(l_file));
              System.out.println(trial.toString());
              //Blob b ;
              //byte[] bytes=trial.toString().getBytes();
              //System.out.println("Size-->"+bytes.length);
              xml_insert.setString(1,new String("SpecailChar"));
              //xml_insert.setBinaryStream(2,new ByteArrayInputStream(bytes),15920);
              xml_insert.setString(3,"SpecailChar");
              xml_insert.executeUpdate();
              p_conn.commit();
              } catch (ClassNotFoundException e) {
                   System.out.println("ClassNotFoundException:"+e.getMessage());
              // Could not find the database driver
              } catch (SQLException e) {
                   System.out.println("SQEXCEPTIN:"+e.getMessage());
              // Could not connect to the database
              }catch (FileNotFoundException e) {
                   System.out.println("filenot found:"+e.getMessage());
              // Could not connect to the database
    Error I'm getting is
    error while trying with jdbc:
    SQEXCEPTIN:[BEA][Oracle JDBC Driver]Error establishing socket to host and port: 10.20.3.19:1521. Reason: Connection refused

    Is the Windows firewall active? Have you enabled the port on the firewall, if it is?

  • Is there a way to reinstall windows 7 from an erased disk? HP support states there is

    Hello,
    I completley erased the hardrive on a Compaq Presario CQ57 that I plan to sell.  I don't have the recovery discs to reinstall Windows 7 Professional 32 bit. 
    I phoned HP and they they told me that although the hard drive is wiped clean, there is a partition that still houses the operating system and does not require disks.  However, they stated they would have to charge an out-of-warranty fee of  $59.99 for the information on how to do this.  Declining such, they stated someone on the forum should be able to help.
    I have searched the forum but have not found a way to restore Windows 7 on the notebook without recovery disks so far.  Was HP support mistaken about bein able to restore Windows without disks?
    Thank you.

    When requesting assistance, please provide the complete model name and/or product number of the HP computer in question. HP/Compaq makes thousands of models of computers. Without this information it may be difficult or impossible to assist you in resolving your issue.
    The above requested information can be found on the bottom of your computer or inside the battery compartment. Please do not include your serial number. Please enter the model/product information into HP's Online Consumer Support page and/or post it here for our review.
    If you only erased the Windows partiton and left the factory recovery partition intact, then yes you can possible recovery the computer with out the discs. If you ereased the entire disc, there is no way to recover the computer to a factory like state without the HP Recovery Disc set.
    Please enter you computer information HERE and select "Drivers", then the original OS to see if an HP Recovery Disc set is available from HP. You can also see if third party vendor www.computersurgeons.com has an HP Recovery Disc set available for your computer.
    Alternatively, if you can still can still read the 25-digit product key on the Microsoft COA affixed to your computer, please see "How to Install Windows 7 Without the Disc" to download Windows 7, create the Windows installation media, and install Windows.  If you prefer to install Windows 7 from a USB Flash Drive, please download the Windows 7 USB/DVD download tool to create a Windows 7 SP1 USB Flash Drive. Please note that you will have to source the needed drivers from HP or directly from the chipset manufacturer's websites. This method will result in a plain Windows installation with no HP customization.
    If you have any further questions, please don't hesitate to ask.
    Please click the white KUDOS star to show your appreciation
    Frank
    {------------ Please click the "White Kudos" Thumbs Up to say THANKS for helping.
    Please click the "Accept As Solution" on my post, if my assistance has solved your issue. ------------V
    This is a user supported forum. I am a volunteer and I don't work for HP.
    HP 15t-j100 (on loan from HP)
    HP 13 Split x2 (on loan from HP)
    HP Slate8 Pro (on loan from HP)
    HP a1632x - Windows 7, 4GB RAM, AMD Radeon HD 6450
    HP p6130y - Windows 7, 8GB RAM, AMD Radeon HD 6450
    HP p6320y - Windows 7, 8GB RAM, NVIDIA GT 240
    HP p7-1026 - Windows 7, 6GB RAM, AMD Radeon HD 6450
    HP p6787c - Windows 7, 8GB RAM, NVIDIA GT 240

  • Unable to get Window Handle for the 'AxCrystalActivXViewer' control.

    Hi,
    I have Operating System : Windows 7 and Application developed in VS 2005 and I am using Crystal Report XI licenced version.
    But when I am trying to use TTX(Field Defination) based reports it gives me "Unable to get Window Handle for the 'AxCrystalActivXViewer' control. Windowless ActivX Controls are not supported."
    Please provide me solution for this ASAP as I am stucked on this from long lomg time.
    -Regards
    Swapnil

    Appears you are installing an upgrade version.
    Use these links:
    http://downloads.businessobjects.com/akdlm/crystalreports/crxir2_sp4_full_bld_0-20008684.exe
    http://downloads.businessobjects.com/akdlm/crystalreports/CRYSTALREPORTS06_0-20008684.EXE

  • Can't remove Contains() handler from SqlFunctionCallHandler - why?

    I'm trying to amend some Entity Framework functionality at runtime by using reflection.
    The following code snippets I've been using to get some feeling for the Entity Framework's internal functionality. Please don't ask what I'm using this for - at this stage it's just a test anyway.
    My code is supposed to remove the Contains() handler from Entity Framework, so a query like this shall fail:
    foreach (T1 a in (from x in ctx.t1
    where x.Name.Contains("Man")
    select x).DefaultIfEmpty()) if (a != null) Console.WriteLine(a.Name);
    However, I don't seem to be able to remove the Contains handler at run-time.
    Can someone please enlighten me on why this doesn't work?
    Here's the code I've been using (I've omitted as much as I could to make the code snippet small):
    using System;
    using System.Data.Entity;
    using System.Data.Entity.SqlServer;
    using System.Diagnostics;
    using System.Linq;
    using System.Reflection;
    using System.Reflection.Emit;
    namespace EF_Contains_Override
    internal class Program
    static private void removeContains()
    Type type = Assembly.GetAssembly(typeof(SqlFunctions)).GetType("System.Data.Entity.SqlServer.SqlGen.SqlFunctionCallHandler");
    FieldInfo fi = type.GetField("_canonicalFunctionHandlers", BindingFlags.Static | BindingFlags.NonPublic);
    object functionHandlerList = fi.GetValue(null);
    MethodInfo method = functionHandlerList.GetType().GetMethod("get_Item", new Type[] { typeof(string) });
    object origContains = method.Invoke(functionHandlerList, new object[] { "Contains" });
    method = functionHandlerList.GetType().GetMethod("Remove", new Type[] { typeof(string) });
    Debug.Assert((bool)method.Invoke(functionHandlerList, new object[] { "Contains" }));
    static private void Main(string[] args)
    Database.SetInitializer<EFContains>(new MyInitializer());
    removeContains();
    using (EFContains ctx = new EFContains())
    foreach (T1 a in (from x in ctx.t1
    where x.Name.Contains("Man")
    select x).DefaultIfEmpty()) if (a != null) Console.WriteLine(a.Name);
    Console.WriteLine("Press any key to continue ...");
    Console.ReadKey();
    Given the following seed, the above select should throw an exception because a Contains() handler no longer exists:
    using System.Data.Entity;
    namespace EF_Contains_Override
    public class MyInitializer : DropCreateDatabaseAlways<EFContains>
    protected override void Seed(EFContains context)
    context.t1.AddRange(new[] { new T1("Hey Man"), new T1("No, woman, no cry") });
    context.SaveChanges();
    Still people out there alive using the keyboard?
    Working with SQL Server/Visual Studio/Office/Windows and their poor keyboard support they seem extinct...

    Hello BetterToday,
    With your provided code and the resource code of Entity Framework downloaded from
    here, I created a similar query with yours:
    using (DFDBEntities db = new DFDBEntities())
    var result = (from o in db.TestTables
    where o.TestName.Contains("1")
    select o).ToList();
    With the resource, the all method are called to help generate the T-SQL are:
    SqlGenerator.GenerateSql, SqlGenerator. VisitExpressionEnsureSqlStatement, SqlGenerator. VisitFilterExpression,
     and in the SqlGenerator.Visit, we see that it converts the Contains to the Like filer and then it called method is WriteSql, we can see that the static class System.Data.Entity.SqlServer.SqlGen.SqlFunctionCallHandler is not called, so it
    would does not affect query even after removing the contains method.
    After searching more, my consult is that for methods as Contains/StartWith/EndWith and some other methods could be translated to TSQL directly, this behavior are by designed.
    You could try with other method as the 'TOLOWER' as:
    static void Main(string[] args)
    try
    #region https://social.msdn.microsoft.com/Forums/en-US/82aaca54-f1cd-47d3-b97c-254ec7b3e8bf/cant-remove-contains-handler-from-sqlfunctioncallhandler-why?forum
    removeContains();
    using (DFDBEntities db = new DFDBEntities())
    var result = (from o in db.TestTables
    where o.TestName.ToLower() == "1"
    select o).ToList();
    #endregion
    catch (Exception)
    static private void removeContains()
    Type type = Assembly.GetAssembly(typeof(SqlFunctions)).GetType("System.Data.Entity.SqlServer.SqlGen.SqlFunctionCallHandler");
    FieldInfo fi = type.GetField("_canonicalFunctionHandlers", BindingFlags.Static | BindingFlags.NonPublic);
    object functionHandlerList = fi.GetValue(null);
    MethodInfo method = functionHandlerList.GetType().GetMethod("get_Item", new Type[] { typeof(string) });
    object origContains = method.Invoke(functionHandlerList, new object[] { "ToLower" });
    method = functionHandlerList.GetType().GetMethod("Remove", new Type[] { typeof(string) });
    Debug.Assert((bool)method.Invoke(functionHandlerList, new object[] { "ToLower" }));
    It would throw an which says “{"'TOLOWER' is not a recognized built-in function name."}” I think it is you except.
    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.

  • Use a window handler in a webutil_c_api.invoke

    Hi
    I need to get the window handler of the forms, but I always get 0 from get_window_property( 'my_win',WINDOW_HANDLE )
    and wen I ran the function:
    webutil_c_api.invoke(ps_dll,'TWAIN_AcquireToFilename',func_param_acq);
    the function send me a messagebox of "invalid window handler", then the twain execute well the function and when it finish, the web browser window is closed.
    Can somebody tell me what is wrong ?
    Is not possible to use a C function in a dll with webutil_c_api, that needs a window handler as a parameter
    Thanx in advance

    Hi
    I need to get the window handler of the forms, but I always get 0 from get_window_property( 'my_win',WINDOW_HANDLE )
    and wen I ran the function:
    webutil_c_api.invoke(ps_dll,'TWAIN_AcquireToFilename',func_param_acq);
    the function send me a messagebox of "invalid window handler", then the twain execute well the function and when it finish, the web browser window is closed.
    Can somebody tell me what is wrong ?
    Is not possible to use a C function in a dll with webutil_c_api, that needs a window handler as a parameter
    Thanx in advance

  • Removing Windows 8 from my MacBook Pro?

    Hello,
    I currently have windows eight installed on my partition. I want to uninstall it so I will be able to run it with parallel desktop. Parallel currently does not support Windows 8 from Bootcamp.
    My question is in order to erase windows 8 what format should I click on? As shown in the screenshot. It was originally highlighted on the last selection ( windows) however, it will not give me the option to erase.
    Thanks,
    Jonathan

    Use Boot Camp Assistant to remove the partition, your disc will be returned to as it was before the partition was made, do not use Disk Utility.

  • Windows handle of the Main Window of the SAPGUI

    Hi experts,
    i need to have the window handle value of the window of the Main MDI window of the SAP GUI from ABAP, does anyone know a FunctionModule or something like this to retrieve this information?
    I need to retrieve information about the geometry of the window (Like the coordinates of the window,..).
    (For 46C)
    Can anyone help me?
    Many thanks and regards,
    Gianpietro Dal Zio

    If this is not something you hope to do programatically .. MS's SPY++ utility will be of assist. If you wish to do it programmically .. I'm a newbie and am unaware of an FM to do it, though if it is possible to call a WIN API Function from ABAP, that may be a course you could persue

  • Windows 8 from TechNet/MSDN to Windows 8.1 via Windows Store, Possible ?

    Windows 8 from TechNet/MSDN can not be updated to Windows 8.1 via Windows Store.
    It says this edition dose not support update via Store.
    Considering that Win8.1 is free for Win8 users, is there a way to bypass this ?
    Can MSDN Windows 8 be converted to Proper Retail Win8 ?

    Windows 8.1 available from MSDN Subscriber Downloads as well Vladimir, so you can get it from there if your subscription is still active. 
    More information about updating to 8.1 on the Windows Store available here: http://windows.microsoft.com/en-us/windows-8/why-can-t-find-update-store.
    This is more of a Windows 8 question because the windows team controls how updates work for their product.  I'd post this question over in http://answers.microsoft.com in the Windows section.
    Thanks,
    Mike
    Unfortunately your post is off topic here, in the MSDN Subscriptions feedback forum, because it is not feedback regarding the MSDN Subscription. This is a standard response I’ve written up in advance to help many people (thousands, really.) who
    happen to post their question in my forum, but please don’t ignore it.  The links provided below I’ve collected to help with many issues we’ve seen.
    For technical issues with Microsoft products that you would run into as an end user of those products, one great source of info and help is
    http://answers.microsoft.com, which has sections for Windows, Hotmail, Office, IE, and other products.   Office related forums are also here:
    http://office.microsoft.com/en-us/support/contact-us-FX103894077.aspx
    For Technical issues with Microsoft products that you might have as an IT professional (like more technical installation issues, or other IT issues), you should head to the TechNet Discussion forums at
    http://social.technet.microsoft.com/forums/en-us, and search for your product name.
    For issues with products you might have as a Developer (like how to talk to APIs, what version of software do what, or other developer issues), you should head to the MSDN discussion forums at
    http://social.msdn.microsoft.com/forums/en-us, and search for your product or issue.
    If you’re asking a question particularly about one of the Microsoft Dynamics products, a great place to start is here:
    http://community.dynamics.com/
    If you really think your issue is related to the MSDN Subscription, and I screwed up, I apologize!  Please repost your question to the discussion forum and include much more detail about your problem, that could include screenshots of the issue
    (do not include subscription information or product keys in your screenshots!), and/or links to the problem you’re seeing. 
    If you really have no idea where to post this question, then you shouldn’t have posted here, because we have a forum just for you!  It’s called the ‘Where is the forum for…?’ forum and its here:
    http://social.msdn.microsoft.com/forums/en-us/whatforum/
    Please review the topic of the forum you’re posting in before posting your question.  Moving your post to the off topic forum.
    Thanks, Mike
    MSDN and TechNet Subscriptions Support

  • Windows Media Player keeping Automatic Maintenance window/Windows Updates from doing auto-restart

    I have a system that is connected to a domain, and it runs a video playlist in Windows Media Player for digital signage upon bootup (and auto-login).  WMP is set to loop the videos over and over again, but it also is preventing automatic updates from
    installing and/or auto-restarting at 3:00AM in the morning (and yes, the system power management is set to keep the computer on all the time).
    How can I fix this?
    I have a GPO set up to install updates and restart automatically (option 4).  I tried the GPO option to use the Windows 8 maintenance window to install updates, and also tried turning that option off and just using a 3:00AM restart period.  Neither
    option seems to work, so it looks like Windows Media Player is preventing an auto-restart to finish the update installation.  Is there any way around this, so that Windows Media Player doesn't stop Windows Updates from doing its job?  I don't care
    if that means the video stops playing because it just starts up again on the next bootup.
    I looked at the WMP GPO's and the only option that sounds like it's related is the option to turn on or off the auto-updating of media info for WMP, but it has nothing to do with what I'm trying to accomplish.  If I missed something, let me know. 
    If there is some other way to accomplish this, such as associating and launching the playlist file with the Xbox Videos app, I would be fine with that, but I need it to loop the playlist continually (I also use the Shuffle option
    in WMP - ***see note below for another question).  I still want the system to automatically install updates and reboot on a regular schedule despite the video playing in the foreground.
    ***Side question: is there any way to turn Repeat and Shuffle options on in WMP without having to load the GUI (for scripting a playlist)?
    Just FYI: this system is actually using Windows Embedded 8.1 Industry Enterprise (from a MAPS account), but it isn't customized aside from not having the standard WinRT apps from a stock Win 8.1 install loaded - it is a stock install from the ISO. 
    From what I understand, it is the same as Windows 8.1 Enterprise, except that it is only licensed to be used as an "appliance" machine for a single role - which it is.  So I'm assuming that there are no actual differences from a "regular"
    Windows 8.1 SKU that would cause this issue.  If I am completely mistaken about this, please notify me on it.  The reason I'm making this statement is in case there are any differences in Embedded 8.1 Industry Enterprise that I am not aware of. 
    Otherwise, I welcome any assistance that would target a "regular" version of 8.1 Enterprise.  NOTE:  Someone said to post this into the Windows Embedded forum, but the only one that exists is the one for POSready - and this is HARDLY the
    POSready version of Windows Embedded that I'm using.

    Hi,
    Did you use the policy Local Computer Policy\Administrative Templates\Windows Components\Windows Update\Always automatically restart at the scheduled time?
    I noticed an description "restart with logged on users for scheduled automatic updates installations" policy is enabled, then this policy has no effect." it means if system installed some updates which unneeds restart computer, this policy would has no effect.
    In my opinion, your problem should not caused by WMP setting. please check your installed updates whether they need restart computer.
    In addition, Power Managment in Control Panel also can prevent the schedule task running.
    Control Panel\System and Security\Power Options\Edit Plan Settings\Change advanced power settings\Sleep\Allow wake timers
    Please make sure this option is enable.
    Roger Lu
    TechNet Community Support

Maybe you are looking for

  • Satellite R630-105 - touchpad temporally freezes

    Hi all, Toshiba Satellite R630-105 model. When writing for a while (using the keyboard) without any rule-based touchpad icon character appears on the screen, and occasionally temporary freezing appears. At the same time I use a USB mouse, and I disab

  • I'm having trouble installing adobe flash player on my Kindle HD

    Hi my name is Derek in I'm having trouble installing adobe flash player for Kindle HD could you please help me.

  • Apple keyboard not working after installing new monitor

    Yesterday I installed a new monitor - HP EliteDisplay E231i - to my Late 2013 Mac Pro.  Previously I had been using super old apple monitors.  My apple keyboard was working great - I had it plugged into the new monitor itself.  I shut down the comput

  • Is anybody else experiencing this problem with IOS5?

    I recently got an iPod Touch 4th generation (last september) and it worked fine until i updated to IOS5. My iPod crashes once in a while (around twice a week), especially when i'm using the iPod camera or when i'm in the music app (trying to find a s

  • Clear balance in local currency

    Dear all, I hope you can help me with following issue. I'm trying to clear 2 documents via F-03 The 2 documents have a balance in local currency of 0 (zero). Normally it should be possible to clear these 2 documents. The problem however is that in th