private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { if (MessageBox.Show("File " + listView1.SelectedItems[0].Text + " will be deleted.\nContinue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { MpqFuncs.deleteFile(mpqHandle, listView1.SelectedItems[0].Text, openMPQPath, closeMpq); openMPQ(openMPQPath); } } }
private void extractToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { string mpqFileName = listView1.SelectedItems[0].Text; if (!MpqFuncs.fileExtact(mpqFileName)) { if (Marshal.GetLastWin32Error() != 0) { MessageBox.Show("Unable to extract file. ErrCode: " + Convert.ToString(Marshal.GetLastWin32Error())); } } } }