logo
down
shadow

Open a file with an HTA application


Open a file with an HTA application

By : mona
Date : November 17 2020, 01:00 AM
fixed the issue. Will look into that further This answer isn't purely HTA since it involves creating an executable with C/C++. I managed to open a file with an HTA by creating an executable with C/C++ (in this case it's exactly the same code in both languages) that I place in the same folder as the HTA which contains this code:
code :
#include <windows.h>
#include <string.h>

int main(int argc,char *argv[]){
   if(argc == 1){
        char *toOpen = malloc(strlen(argv[0]) + 47);
        strcpy(toOpen,"\"C:\\Windows\\System32\\mshta.exe\" \"");
        strcat(toOpen,argv[0]);
        *strrchr(toOpen,'\\') = '\0';
        strcat(toOpen,"\\example.hta\"");
        WinExec(toOpen,SW_SHOWMAXIMIZED);
        free(toOpen);
    }
    else{
        char *toOpen = malloc(strlen(argv[0]) + strlen(argv[1]) + 48);
        strcpy(toOpen,"\"C:\\Windows\\System32\\mshta.exe\" \"");
        strcat(toOpen,argv[0]);
        *strrchr(toOpen,'\\') = '\0';
        strcat(toOpen,"\\example.hta?");
        strcat(toOpen,argv[1]);
        strcat(toOpen,"\"");
        WinExec(toOpen,SW_SHOWMAXIMIZED);
        free(toOpen);
    }
    return 0;
}
<script type="text/javascript">
    window.onload = function(){
        var arr = location.href.split("?");
        if(arr.length == 2){
            f(arr[1]);  //f() is the function called when opening a file
        }
    }
</script>
"C:\Users\Donald\example.exe" "%1"


Share : facebook icon twitter icon
Qt Application switches focus to a different application after using a file open dialog

Qt Application switches focus to a different application after using a file open dialog


By : EGYPTOOL
Date : March 29 2020, 07:55 AM
Hope that helps You probably just forgot to set the parent for the QFileDialog - you need to pass the pointer to the current window to getOpenFileName:
code :
 QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"),
                                             "",
                                             tr("Images (*.png *.xpm *.jpg)"));
How Do I Give My C++ Application The File Path Of The File Clicked To Open Said Application

How Do I Give My C++ Application The File Path Of The File Clicked To Open Said Application


By : Hackealo Team
Date : March 29 2020, 07:55 AM
hop of those help? Windows doesn't know a priori how your program should be started. Perhaps it's d:\path\to\exe\foo.exe --no-spash --input-file "C:\what you\clicked.foofile". That's why you put in a registry entry, to tell Windows.
Now there's of course one part of that string above which you don't know up front, and that's of course "C:\what you\clicked.foofile". In the registry entry, use "%1" and Windows will substitute the actual path. Don't forget the " " since paths can contain spaces, and else your path will end up in argv[1] and argv[2]. That was especially common in XP, with My Documents.
Open PDF file in my android application without using any browser or third party application

Open PDF file in my android application without using any browser or third party application


By : Ruhul
Date : March 29 2020, 07:55 AM
wish helps you I have already searched a lot on this topic but I could not able to find the proper answer. I kindly request to not mark it with duplication without answer. , Send file name from FirstActivity to SecondActivity.
code :
Intent i=new Intent(FirstActivity.this, SecondActivity.class);
 i.putExtra("file", fileUrl);
 startActivity(i);
Intent i = getIntent();
    String myPdfUrl = i.getStringExtra("file");
    String url = "http://docs.google.com/gview?embedded=true&url=" + myPdfUrl;
    String doc="<iframe src='"+url+"' width='100%' height='100%' style='border: none;'></iframe>";
    WebView web=(WebView)findViewById(R.id.webViewpdf);
    webView.getSettings().setJavaScriptEnabled(true); 
    webView.loadData(doc, "text/html", "UTF-8");
<LinearLayout 
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent">

    <WebView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/webViewpdf"/>

</LinearLayout>
UWP - Can't open file for reading if another application has it open

UWP - Can't open file for reading if another application has it open


By : Mike Wei
Date : March 29 2020, 07:55 AM
should help you out This is expected behavior for the Universal APIs as of the Anniversary Update. (aka RS1). The Windows.Storage.* APIs and streams use what is called a "Polite Reader" model. In this model readers can be interrupted by a writer, which generates the OPLOCK break errors. In RS1 this also means that readers are blocked if ANY open handle for write exists already.
In the Creators Update (aka RS2) some things are changing on this. As the Universal Platform evolved from the original WinRT with a single foreground app, the need to allow apps to use more traditional models arose. Thus, in RS2 we are making a few changes to help in this scenario.
Launching application from server creates Open File for lifetime of application

Launching application from server creates Open File for lifetime of application


By : Damian Cray
Date : March 29 2020, 07:55 AM
To fix the issue you can do I believe that Windows doesn't load an entire executable into ram. It isn't just about files from the resource section of a PE file. Portions of the exe are only loaded when referenced and even after loading everything there is to load, Windows will maintain an open file handle until the process closes. Trying to close that handle yourself is a bad idea.
c/c++ allow a "SWAPFILE" flag to be specified that tells windows to put the whole thing into the page file but I don't know how you would do that with c# and I don't know if that would even stop windows from keeping the handle open anyways (I doubt it).
Related Posts Related Posts :
  • Decimal output parameter rounded to integer in EF5.0
  • Error when deploying ear in weblogic 11g
  • autocomplete with extjs :ComboBox with REMOTE query store
  • How to make full background color in skeleton, responsive 960 grid?
  • How to send a variable of type struct in MPI_Send()?
  • I accidentally deleted a picture in my album on FB and it was uploaded years ago and I dont have a copy how can i get it
  • Does setting techOrder for video.js really work?
  • What are XMPP extensions (XEPs), and how do I use them?
  • Interactive alternative to dot?
  • Doctrine 2: how do you use a subquery column (in the SELECT clause)
  • Merging graphs using boost graph
  • Creating Order Item Grid in Magento
  • Can't remap Ctrl+W to the F2 key in autohotkey
  • Property 'throw' does not exist on type 'typeof Observable'
  • Unable to deploy SAPUI5 application with 404 error
  • Xcode 10 build fail rm permission denied in /bin/sh/
  • Handling quorum writies fail on Cassandra
  • How to finalize log file just after time is over when using logback SizeAndTimeBasedFNATP?
  • Write custom widget with GTK3
  • How to remove UINavigationBar inner shadow in iOS 7?
  • Wordpress dynamic widget by location?
  • XDocument replace all node value with lower case
  • Invalid tagdir attribute while web-fragment is used
  • Set default font/text size in RTF Control
  • what video formats supported by chromecast device (mp4,flv,m3u8,flv,avi)?
  • sbcl - how to muffle "undefined variable" warning?
  • Get an eventbrite event ID
  • Obtain date without timestamp in DB2
  • Cron job to SFTP files in a directory
  • Draw two head arrows in fabric.js
  • YOLO darknet vs darkflow
  • Parse custom rss tags using Rome API
  • Creating text editor like EDIT on Command Prompt using FreePascal
  • Subplot hides xlabel
  • NServiceBus long running process that timesout
  • Qt4 - How to add a row in a QTableWidget when sorting is enable?
  • Cancel command in Grunt that hasn't been launched
  • Canvas globalCompositeOperation is not working correctly
  • HTML.Kendo().Dropdownlist set default item
  • vagrant up failed, /dev/vboxnetctl: no such file or directory
  • How to use jssor carousel to build client carousal
  • Theory what is meant by validating security concerns for these user groups
  • How to build correct SPARQL Query
  • Connecting to MySQL (on Google Cloud SQL) via JDBC and IPv6?
  • Fetching transaction in several iterations
  • is it possible to use dropbox datastore api as shared datastore?
  • phpExcel 1.8 Named Ranges in Formula
  • Cisco VPN IP address
  • No address associated with hostname using vagrant
  • 2 way data-binding between a polymer component and a model?
  • How can I rename an already published app in the Windows Dev Center?
  • Using Chef 12 , Chef Client unable to connect to chef Server
  • GCM notification not working (GoogleCloudMessaging)
  • Measured GFLOPS is greater then theoretical GFLOPS
  • Progress ABL - strip and add to temp table
  • Errors occuring when make-ing Aircrack-ng on raspberry pi
  • Detecting Handedness from Device Use
  • Query a manual list of data items
  • Similar to pivot - Windows 8.1 Desktop app
  • CKEDITOR And Styles configuration with only toolbar
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org